From f6b51710fec5433036dd3fe6cb5d8c4e564e7736 Mon Sep 17 00:00:00 2001 From: fengmk2 Date: Sat, 25 Feb 2017 01:32:22 +0800 Subject: [PATCH] fix: use co-mocha instead of thunk-mocha (#38) --- .autod.conf | 2 +- README.md | 6 +++--- README.zh-CN.md | 6 +++--- lib/helper.js | 2 +- package.json | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.autod.conf b/.autod.conf index d87055e7..9d26534f 100644 --- a/.autod.conf +++ b/.autod.conf @@ -10,7 +10,7 @@ module.exports = { dep: [ 'istanbul', 'mocha', - 'thunk-mocha', + 'co-mocha', 'intelli-espower-loader', 'power-assert', ], diff --git a/README.md b/README.md index 543433a7..1aa1edca 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ $ egg-bin debug ### test -Using [mocha] with [thunk-mocha] to run test. +Using [mocha] with [co-mocha] to run test. [power-assert] is the default `assert` library, and [intelli-espower-loader] will be auto required. @@ -214,10 +214,10 @@ run nsp check at /foo/bar with [] [mocha]: https://mochajs.org -[thunk-mocha]: https://npmjs.com/thunk-mocha +[co-mocha]: https://npmjs.com/co-mocha [glob]: https://github.com/isaacs/node-glob [istanbul]: https://github.com/gotwarlost/istanbul -[nsp]: https://npmjs.com/thunk-mocha +[nsp]: https://npmjs.com/nsp [iron-node]: https://github.com/s-a/iron-node [intelli-espower-loader]: https://github.com/power-assert-js/intelli-espower-loader [power-assert]: https://github.com/power-assert-js/power-assert diff --git a/README.zh-CN.md b/README.zh-CN.md index 1ec389ba..f0cd6a91 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -78,7 +78,7 @@ $ egg-bin debug ### test -测试工具,使用 [mocha],支持 [thunk-mocha] 扩展。 +测试工具,使用 [mocha],支持 [co-mocha] 扩展。 内置了 [intelli-espower-loader] 并使用 [power-assert] 作为断言库,具体参见 https://github.com/atian25/blog/issues/16 。 在测试代码中只需要 `require('assert')` 即可享受 [power-assert] 带来的体验提升。 @@ -189,9 +189,9 @@ run nsp check at /foo/bar with [] [mocha]: https://mochajs.org -[thunk-mocha]: https://npmjs.com/thunk-mocha +[co-mocha]: https://npmjs.com/co-mocha [glob]: https://github.com/isaacs/node-glob [istanbul]: https://github.com/gotwarlost/istanbul -[nsp]: https://npmjs.com/thunk-mocha +[nsp]: https://npmjs.com/nsp [intelli-espower-loader]: https://github.com/power-assert-js/intelli-espower-loader [power-assert]: https://github.com/power-assert-js/power-assert diff --git a/lib/helper.js b/lib/helper.js index 08f4e90a..4d50e160 100644 --- a/lib/helper.js +++ b/lib/helper.js @@ -30,7 +30,7 @@ exports.getTestSetupFile = () => { exports.formatTestArgs = args => { const newArgs = [ '--timeout', process.env.TEST_TIMEOUT || '30000', - '--require', require.resolve('thunk-mocha'), + '--require', require.resolve('co-mocha'), ]; if (process.env.TEST_REPORTER) { newArgs.push('--reporter'); diff --git a/package.json b/package.json index 93ac4627..72a56c69 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "mocha": "bin/mocha.js" }, "dependencies": { + "co-mocha": "^1.2.0", "commander": "^2.9.0", "common-bin": "^1.0.0", "debug": "^2.6.0", @@ -19,8 +20,7 @@ "mkdirp": "^0.5.1", "mocha": "^3.2.0", "power-assert": "^1.4.2", - "rimraf": "^2.5.4", - "thunk-mocha": "^1.0.8" + "rimraf": "^2.5.4" }, "devDependencies": { "autod": "^2.7.1",