Skip to content

Commit 9808038

Browse files
test: use mocha instead of nodeunit (axios#1655)
1 parent 0c4bf3c commit 9808038

File tree

4 files changed

+197
-188
lines changed

4 files changed

+197
-188
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Please update the docs accordingly so that there are no discrepencies between th
2525

2626
### Developing
2727

28-
- `grunt test` run the jasmine and nodeunit tests
28+
- `grunt test` run the jasmine and mocha tests
2929
- `grunt build` run webpack and bundle the source
3030
- `grunt version` prepare the code for release
3131
- `grunt watch:test` watch for changes and run `test`

Gruntfile.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,13 @@ module.exports = function(grunt) {
6565
}
6666
},
6767

68-
nodeunit: {
69-
all: ['test/unit/**/*.js']
68+
mochaTest: {
69+
test: {
70+
src: ['test/unit/**/*.js']
71+
},
72+
options: {
73+
timeout: 30000,
74+
},
7075
},
7176

7277
watch: {
@@ -96,7 +101,7 @@ module.exports = function(grunt) {
96101
grunt.file.write('bower.json', JSON.stringify(bower, null, 2));
97102
});
98103

99-
grunt.registerTask('test', 'Run the jasmine and nodeunit tests', ['eslint', 'nodeunit', 'karma:single', 'ts']);
104+
grunt.registerTask('test', 'Run the jasmine and mocha tests', ['eslint', 'mochaTest', 'karma:single', 'ts']);
100105
grunt.registerTask('build', 'Run webpack and bundle the source', ['clean', 'webpack']);
101106
grunt.registerTask('version', 'Sync version info for a release', ['usebanner', 'package2bower']);
102107
};

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
"grunt-banner": "^0.6.0",
4040
"grunt-cli": "^1.2.0",
4141
"grunt-contrib-clean": "^1.1.0",
42-
"grunt-contrib-nodeunit": "^1.0.0",
4342
"grunt-contrib-watch": "^1.0.0",
4443
"grunt-eslint": "^20.1.0",
4544
"grunt-karma": "^2.0.0",
45+
"grunt-mocha-test": "^0.13.3",
4646
"grunt-ts": "^6.0.0-beta.19",
4747
"grunt-webpack": "^1.0.18",
4848
"istanbul-instrumenter-loader": "^1.0.0",
@@ -61,11 +61,12 @@
6161
"karma-webpack": "^1.7.0",
6262
"load-grunt-tasks": "^3.5.2",
6363
"minimist": "^1.2.0",
64+
"mocha": "^5.2.0",
6465
"sinon": "^4.5.0",
65-
"webpack": "^1.13.1",
66-
"webpack-dev-server": "^1.14.1",
66+
"typescript": "^2.8.1",
6767
"url-search-params": "^0.10.0",
68-
"typescript": "^2.8.1"
68+
"webpack": "^1.13.1",
69+
"webpack-dev-server": "^1.14.1"
6970
},
7071
"browser": {
7172
"./lib/adapters/http.js": "./lib/adapters/xhr.js"

0 commit comments

Comments
 (0)