Skip to content

Commit 454865b

Browse files
committed
setup initial test
1 parent 9c32e05 commit 454865b

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

mocha.opts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--full-trace
2+
--compilers js:babel/register
3+
--recursive ./tests/**/*.jsx

package.json

100755100644
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"example": "example"
88
},
99
"scripts": {
10-
"build": "gulp clean && NODE_ENV=production gulp build"
10+
"build": "gulp clean && NODE_ENV=production gulp build",
11+
"test": "mocha --opts ./mocha.opts; eslint ./src/ --ext .jsx,.js --global require,exports:true"
1112
},
1213
"repository": {
1314
"type": "git",
@@ -28,8 +29,12 @@
2829
"url": "https://github.com/legitcode/modal/issues"
2930
},
3031
"devDependencies": {
31-
"react-component-gulp-tasks": "^0.7.0",
32-
"gulp": "^3.8.11"
32+
"babel": "^5.8.23",
33+
"chai": "^3.3.0",
34+
"gulp": "^3.8.11",
35+
"legit-tests": "^0.4.4",
36+
"mocha": "^2.3.3",
37+
"react-component-gulp-tasks": "^0.7.0"
3338
},
3439
"homepage": "https://github.com/legitcode/modal",
3540
"dependencies": {

tests/modal.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Test from 'legit-tests'
2+
import { expect } from 'chai';
3+
4+
import Modal from '../src/simple-modal'
5+
6+
describe('Modal', () => {
7+
let close = () => {
8+
9+
}
10+
11+
it('should return nothing until clicked', () => {
12+
Test(<Modal show={false} onClose={close}/>)
13+
.test(({instance}) =>{
14+
expect(instance.innerHTML).to.be.equal(undefined)
15+
})
16+
});
17+
18+
});

0 commit comments

Comments
 (0)