Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run all tests declared with .only, not just the last one #1755

Closed
SystemParadox opened this issue Jun 18, 2015 · 2 comments
Closed

Run all tests declared with .only, not just the last one #1755

SystemParadox opened this issue Jun 18, 2015 · 2 comments

Comments

@SystemParadox
Copy link

At the moment, if multiple tests are declared with describe.only or it.only, mocha will only run the last one it finds.

It would be much more useful if mocha would run all tests declared with .only. I regularly want to run a few selected tests, or check another test in addition to the one I am currently working on.

Also, with the current behaviour it is impossible to select some tests when they are generated. Consider:

function test(mode) {
    it.only('should do something with mode', function () {
        assert(foobar(mode));
    });

    // many more tests
}

describe('foobar', function () {
    test('foo');
    test('bar');
});

This will only run the test for 'bar'. It is impossible to select just 'foo'. It would be much more useful to run all of them.

Thanks.

Related: #1060, #1676

@domarmstrong
Copy link

There is a PR that implements this #1591 awaiting merge for 3.0

@boneskull
Copy link
Member

closing this since #1591 should address it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants