Skip to content
Permalink
Browse files

fix: force exit when runner complete (#83)

  • Loading branch information
popomore authored and atian25 committed Oct 10, 2017
1 parent a7c4b53 commit 7386194d94ec8b0d0faee766fe98f0f4f2ece8a2
Showing with 26 additions and 0 deletions.
  1. +2 −0 lib/cmd/test.js
  2. +16 −0 test/fixtures/no-exit/test/foo.test.js
  3. +8 −0 test/lib/cmd/test.test.js
@@ -59,6 +59,8 @@ class TestCommand extends Command {
/* istanbul ignore next */
testArgv.timeout = testArgv.timeout || process.env.TEST_TIMEOUT || 60000;
testArgv.reporter = testArgv.reporter || process.env.TEST_REPORTER;
// force exit
testArgv.exit = true;

if (debug) {
// --no-timeouts
@@ -0,0 +1,16 @@
'use strict';

const http = require('http');
const assert = require('assert');

describe('mocha-test', () => {
it('should work', () => {
assert(true);
});
});

const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('okay');
});
server.listen();
@@ -110,6 +110,14 @@ describe('test/lib/cmd/test.test.js', () => {
.end();
});

it('should force exit', () => {
const cwd = path.join(__dirname, '../../fixtures/no-exit');
return coffee.fork(eggBin, [ 'test' ], { cwd })
.debug()
.expect('code', 0)
.end();
});

describe('simplify mocha error stack', () => {
const cwd = path.join(__dirname, '../../fixtures/test-files-stack');

0 comments on commit 7386194

Please sign in to comment.
You can’t perform that action at this time.