Skip to content

Commit

Permalink
feat: build-in intelli-espower-loader
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 committed Dec 13, 2016
1 parent 8bf9aa0 commit 8a8b3ff
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 17 deletions.
12 changes: 9 additions & 3 deletions .autod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ module.exports = {
exclude: [
'test/fixtures',
],
dep: [
'istanbul',
'mocha',
'thunk-mocha',
'intelli-espower-loader',
],
devdep: [
'autod',
'eslint-config-egg',
'eslint',
'egg-ci',
],
keep: [
'istanbul',
'mocha',
'thunk-mocha',
],
semver: [
],
Expand Down
1 change: 1 addition & 0 deletions lib/cov_command.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class CovCommand extends Command {
'--',
'--timeout', process.env.TEST_TIMEOUT || '200000',
'--require', require.resolve('thunk-mocha'),
'--require', require.resolve('intelli-espower-loader'),
]).concat(this.helper.getTestFiles()).concat(args);

return covArgs;
Expand Down
1 change: 1 addition & 0 deletions lib/test_command.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class TestCommand extends Command {
'--reporter', process.env.TEST_REPORTER || 'spec',
'--timeout', process.env.TEST_TIMEOUT || '30000',
'--require', require.resolve('thunk-mocha'),
'--require', require.resolve('intelli-espower-loader'),
].concat(this.helper.getTestFiles()).concat(args);
process.env.NODE_ENV = 'test';

Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@
"childprocess": "^2.0.2",
"commander": "^2.9.0",
"common-bin": "^1.0.0",
"debug": "^2.2.0",
"debug": "^2.3.3",
"egg-utils": "^1.0.0",
"glob": "^7.1.1",
"istanbul": "^0.4.0",
"intelli-espower-loader": "^1.0.1",
"istanbul": "^0.4.5",
"mkdirp": "^0.5.1",
"mocha": "^3.0.0",
"mocha": "^3.2.0",
"rimraf": "^2.5.4",
"semver": "^5.3.0",
"thunk-mocha": "^1.0.3"
"thunk-mocha": "^1.0.8"
},
"devDependencies": {
"autod": "^2.7.1",
"coffee": "^3.3.0",
"egg-ci": "1",
"eslint": "3",
"eslint-config-egg": "3",
"intelli-espower-loader": "^1.0.1",
"egg-ci": "^1.1.0",
"eslint": "^3.12.1",
"eslint-config-egg": "^3.2.0",
"mm": "^2.0.0",
"power-assert": "^1.4.1"
"power-assert": "^1.4.2"
},
"repository": {
"type": "git",
Expand All @@ -39,8 +39,8 @@
"author": "fengmk2 <[email protected]> (https://fengmk2.com)",
"scripts": {
"lint": "eslint bin lib test *.js",
"test": "TEST_TIMEOUT=3600000 TESTS=test/*.test.js bin/egg-bin.js test -r intelli-espower-loader",
"cov": "TEST_TIMEOUT=3600000 TESTS=test/*.test.js bin/egg-bin.js cov -r intelli-espower-loader",
"test": "TEST_TIMEOUT=3600000 TESTS=test/*.test.js bin/egg-bin.js test",
"cov": "TEST_TIMEOUT=3600000 TESTS=test/*.test.js bin/egg-bin.js cov",
"ci": "npm run lint && npm run cov",
"autod": "autod"
},
Expand Down
2 changes: 1 addition & 1 deletion test/egg-cov.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('egg-bin cov', () => {

it('should fail when test fail with power-assert', done => {
mm(process.env, 'TESTS', 'test/power-assert-fail.js');
coffee.fork(eggBin, [ 'cov', '-r', 'intelli-espower-loader' ], {
coffee.fork(eggBin, [ 'cov' ], {
cwd: appdir,
})
.coverage(false)
Expand Down
2 changes: 1 addition & 1 deletion test/egg-dev.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('egg-bin dev', () => {
coffee.fork(eggBin, [ 'dev', '--debug=7000' ], {
cwd: appdir,
})
// .debug()
.debug()
.expect('stdout', `{"baseDir":"${appdir}","workers":1}\n`)
.expect('stderr', /Debugger listening on .*7000/)
.expect('code', 0)
Expand Down
2 changes: 1 addition & 1 deletion test/egg-test.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('egg-bin test', () => {

it('should fail when test fail with power-assert', done => {
mm(process.env, 'TESTS', 'test/power-assert-fail.js');
coffee.fork(eggBin, [ 'cov', '-r', 'intelli-espower-loader' ], { cwd })
coffee.fork(eggBin, [ 'cov' ], { cwd })
.coverage(false)
// .debug()
.expect('stdout', /1\) should fail/)
Expand Down

0 comments on commit 8a8b3ff

Please sign in to comment.