Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

debug box

Craig Taub45c58eeccc4e
diff --git a/test/integration/fixtures/mocha-process-hanging.fixture.js b/test/integration/fixtures/mocha-process-hanging.fixture.js
index 324374a2..5df91987 100644
--- a/test/integration/fixtures/mocha-process-hanging.fixture.js
+++ b/test/integration/fixtures/mocha-process-hanging.fixture.js
@@ -3,4 +3,7 @@
require('../../../bin/_mocha');
process.stdout.on('data', function(data) {});
-describe('hanging process', function() {});
+describe('hanging process', function() {
+ it('test should pass', function () {
+ });
+});
diff --git a/test/integration/options.spec.js b/test/integration/options.spec.js
index 83ab883f..375056cb 100644
--- a/test/integration/options.spec.js
+++ b/test/integration/options.spec.js
@@ -509,7 +509,11 @@ describe('options', function() {
describe('with watch enabled', function() {
it('should return correct output when watch process is terminated', function(done) {
// After the process ends, this callback is ran
- var assertionCallback = function(err, data) {
+
+ this.timeout(0);
+ this.slow(3000);
+ // executes Mocha in a subprocess
+ var mocha = directInvokeBlocking(['--watch'], function(err, data) {
clearTimeout(t);
if (err) {
done(err);
@@ -517,19 +521,16 @@ describe('options', function() {
}
var expectedCloseCursor = '\u001b[?25h';
- expect(data.output).to.contain(expectedCloseCursor);
- expect(data.code).to.equal(130);
+ console.log('data', data);
+ expect(data.output, 'to contain', expectedCloseCursor);
+ expect(data.code, 'to be', 130);
done();
- };
-
- this.timeout(0);
- this.slow(3000);
- // executes Mocha in a subprocess
- var mocha = directInvokeBlocking(['--watch'], assertionCallback);
+ });
var t = setTimeout(function() {
// kill the child process
+ console.log('TIMER SIGINT')
mocha.kill('SIGINT');
- }, 2000);
+ }, 500);
});
});
});