From 55a989075dea18a34acd0ca06e78025b5dafd89f Mon Sep 17 00:00:00 2001 From: TZ Date: Thu, 4 Apr 2019 10:41:56 +0800 Subject: [PATCH] ff --- lib/cmd/test.js | 2 ++ test/lib/cmd/test.test.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cmd/test.js b/lib/cmd/test.js index f49a3d2c..e74e29a9 100644 --- a/lib/cmd/test.js +++ b/lib/cmd/test.js @@ -85,11 +85,13 @@ class TestCommand extends Command { // whether is debug mode, if pass --inspect then `debugOptions` is valid // others like WebStorm 2019 will pass NODE_OPTIONS, and egg-bin itself will be debug, so could detect `process.env.JB_DEBUG_FILE`. + if (debugOptions || process.env.JB_DEBUG_FILE) { // --no-timeouts testArgv.timeouts = false; testArgv.timeout = undefined; } + console.log('@@@', debugOptions, process.env.JB_DEBUG_FILE, testArgv); // collect require let requireArr = testArgv.require || testArgv.r || []; diff --git a/test/lib/cmd/test.test.js b/test/lib/cmd/test.test.js index ca3a62e0..283c9dc9 100644 --- a/test/lib/cmd/test.test.js +++ b/test/lib/cmd/test.test.js @@ -232,11 +232,12 @@ describe('test/lib/cmd/test.test.js', () => { }); }); - describe('no-timeouts', () => { + describe.only('no-timeouts', () => { it('should timeout', done => { + mm(process.env, 'TEST_TIMEOUT', '5000'); mm(process.env, 'TESTS', 'test/**/no-timeouts.test.js'); coffee.fork(eggBin, [ 'test' ], { cwd }) - .expect('stdout', /timeout: 60000/) + .expect('stdout', /timeout: 5000/) .expect('code', 0) .end(done); });