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

Add configuration to skip particular test point using test point name #1259

Closed
muthu90ec opened this issue Feb 1, 2018 · 2 comments
Closed

Comments

@muthu90ec
Copy link

muthu90ec commented Feb 1, 2018

Qunit version 2.5.0
Env = browser
just loading it in browser

Running in browser:
chrome v62

What are you trying to do?

It would be easy to have a qunit configuration that can skip available test points using test point names
For eg:
QUnit.config.testPointsToSkip = ['hello test', 'test point name 2']

QUnit.test( "hello test", function( assert ) {
assert.ok( 1 == "1", "Passed!" );
});

This will skip hello test.

@platinumazure
Copy link
Contributor

platinumazure commented Feb 1, 2018

I think you might be able to use QUnit.config.filter to do what you need. QUnit.config.filter accepts a regular expression; you could conceivably do something like this:

const testsToSkip = ["hello test"];

QUnit.config.filter = new RegExp(`^(?!(?:${testsToSkip.join("|")})$).*$`);

Note that this implementation will fail for strings that use regex special characters, so you would want to be sure to escape regex metacharacters in your own strings before setting QUnit.config.filter.

@trentmwillis
Copy link
Member

Closing this issue as I believe @platinumazure's solution is appropriate. @muthu90ec if you feel we need an additional API for the use case, then feel free to reopen with some explanation.

Thanks for the issue! 🙂

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

No branches or pull requests

3 participants