Skip to content

Commit cf5c5b7

Browse files
committed
test(Jest): Migrate from Mocha/Chai to Jest
1 parent b6f33e6 commit cf5c5b7

File tree

4 files changed

+616
-618
lines changed

4 files changed

+616
-618
lines changed

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
"babel-plugin-transform-object-rest-spread": "^6.23.0",
3333
"babel-plugin-transform-runtime": "^6.23.0",
3434
"babel-preset-env": "^1.5.2",
35-
"chai": "^4.0.1",
36-
"chai-as-promised": "^6.0.0",
37-
"chai-spies": "0.7.1",
3835
"cz-conventional-changelog": "^2.0.0",
3936
"eslint": "^3.19.0",
4037
"eslint-config-airbnb-base": "^11.2.0",
@@ -45,11 +42,9 @@
4542
"flow-bin": "^0.47.0",
4643
"graphql": "^0.10.1",
4744
"graphql-compose": "^1.20.4",
48-
"mocha": "^3.4.2",
49-
"nyc": "^11.0.2",
45+
"jest": "^20.0.4",
5046
"prettier": "^1.4.4",
5147
"rimraf": "^2.6.1",
52-
"sane": "^1.7.0",
5348
"semantic-release": "^6.3.6"
5449
},
5550
"dependencies": {
@@ -60,16 +55,23 @@
6055
"path": "./node_modules/cz-conventional-changelog"
6156
}
6257
},
58+
"jest": {
59+
"roots": [
60+
"<rootDir>/src"
61+
]
62+
},
6363
"scripts": {
6464
"build": "npm run build-cjs && npm run build-flow",
6565
"build-cjs": "rimraf lib && babel src --ignore __tests__,__mocks__ -d lib",
6666
"build-flow": "find ./src -name '*.js' -not -path '*/__*' | while read filepath; do cp $filepath `echo $filepath | sed 's/\\/src\\//\\/lib\\//g'`.flow; done",
67-
"coverage": "nyc npm run test",
67+
"coverage": "jest --coverage",
6868
"lint": "eslint src test *.js",
69-
"test": "babel-node ./node_modules/.bin/_mocha --compilers js:babel-core/register --reporter dot --require ./resources/mocha-bootload src/**/__tests__/**/*-test.js",
70-
"watch": "babel-node ./resources/watch.js",
69+
"test": "jest",
70+
"watch": "jest --watch",
71+
"flow": "./node_modules/.bin/flow stop && ./node_modules/.bin/flow",
72+
"all": "npm run test && npm run lint && npm run flow",
7173
"link": "yarn build && yarn link graphql-compose && yarn link",
72-
"unlink": "yarn unlink graphql-compose && graphql-compose",
74+
"unlink": "yarn unlink graphql-compose && yarn add graphql-compose",
7375
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
7476
}
7577
}

resources/mocha-bootload.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

resources/watch.js

Lines changed: 0 additions & 195 deletions
This file was deleted.

0 commit comments

Comments
 (0)