Skip to content

Commit

Permalink
Merge pull request #1 from paranoidjk/master
Browse files Browse the repository at this point in the history
chore: use latest version
  • Loading branch information
Lucifier129 authored May 14, 2017
2 parents 7cb1f64 + a8c032f commit 1516ee2
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 11 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# react-core-unit-testing

Modify `src/index.js`, and `npm test` run the test.
## How to

```bash
npm install // install deps
npm tun test // run all test
npm tun test:react // run test with react
npm tun test:preact // run test with preact
npm tun test:inferno // run test with inferno
npm tun test:react-lite // run test with react-lite
```
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
"version": "1.0.0",
"description": "react core unit testing",
"scripts": {
"test": "jest"
"test": "npm run test:preact && npm run test:inferno && npm run react-lite",
"test:react": "jest",
"test:preact": "TEST_ENV=preact jest",
"test:inferno": "TEST_ENV=inferno jest",
"test:react-lite": "TEST_ENV=react-lite jest"
},
"jest": {
"scriptPreprocessor": "<rootDir>/jest/preprocessor.js",
Expand All @@ -24,10 +28,11 @@
"webpack": "^1.12.2"
},
"dependencies": {
"inferno": "^0.7.27",
"inferno-compat": "^0.7.27",
"preact": "^7.1.0",
"preact-compat": "^3.9.3",
"react-lite": "^0.15.28"
"inferno": "latest",
"inferno-compat": "latest",
"preact": "latest",
"preact-compat": "latest",
"react": "latest",
"react-lite": "latest"
}
}
27 changes: 23 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
import React from 'react-lite'
// import React from 'preact-compat'
// import React from 'inferno-compat'
import ReactLite from 'react-lite'
import Preact from 'preact-compat'
import Inferno from 'inferno-compat'
import React from 'react';

export default React
const env = process.env.TEST_ENV;

let testObj = React;

switch (env) {
case 'react-lite':
testObj = ReactLite;
break;
case 'preact':
testObj = Preact;
break;
case 'inferno':
testObj = Inferno;
break;
default:
}


export default testObj;

0 comments on commit 1516ee2

Please sign in to comment.