When I run a test with --delay, and I specify only(), the entire test suite gets run, not just the only block.
@wlingke can you please provide some example code
run below with --delay will fail yield in test two being run.
var assert = require('assert')
setTimeout(function(){
describe.only('Should only run this', function(){
it('passing test', function(){
assert(true)
})
});
describe('Should not run this', function(){
it('failing test', function(){
assert(false)
})
});
run()
}, 1000);
Can confirm.
I am a bot that watches issues for inactivity.
This issue hasn't had any recent activity, and I'm labeling it stale. In 14 days, if there are no further comments or activity, I will close this issue.
Thanks for contributing to Mocha!
Can confirm to keep this from closing.
Yup, tried it out and this is still an issue.
Surprising, because only got redesigned and rewritten in version 3.
Fix: move https://github.com/mochajs/mocha/blob/16ffca210267b06300c9c54f886a031ea6a9030d/lib/runner.js#L813-L816 to between https://github.com/mochajs/mocha/blob/16ffca210267b06300c9c54f886a031ea6a9030d/lib/runner.js#L824 and https://github.com/mochajs/mocha/blob/16ffca210267b06300c9c54f886a031ea6a9030d/lib/runner.js#L825
How to write tests for it though... probably will have to use the test/integration model with test/integration/fixtures...
Hi, @ScottFreeCode. I have created the following PR for the fix. Thanks for the instructions.
https://github.com/mochajs/mocha/pull/3215
This issue can be closed, see PR #3215