-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(runner): fix '.only()' exclusive feature, #1481 #1591
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Root-only test cases | ||
it.only('#Root-Suite, should run this bdd test-case #1', function() { | ||
(true).should.equal(true); | ||
}); | ||
|
||
it('#Root-Suite, should not run this bdd test-case #2', function() { | ||
(false).should.equal(true); | ||
}); | ||
|
||
it('#Root-Suite, should not run this bdd test-case #3', function() { | ||
(false).should.equal(true); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Root-only test cases | ||
test.only('#Root-Suite, should run this qunit test-case #1', function() { | ||
(true).should.equal(true); | ||
}); | ||
|
||
test('#Root-Suite, should not run this qunit test-case #2', function() { | ||
(false).should.equal(true); | ||
}); | ||
|
||
test('#Root-Suite, should not run this qunit test-case #3', function() { | ||
(false).should.equal(true); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Root-only test cases | ||
test.only('#Root-Suite, should run this tdd test-case #1', function() { | ||
(true).should.equal(true); | ||
}); | ||
|
||
test('#Root-Suite, should not run this tdd test-case #2', function() { | ||
(false).should.equal(true); | ||
}); | ||
|
||
test('#Root-Suite, should not run this tdd test-case #3', function() { | ||
(false).should.equal(true); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,125 @@ | ||
describe('should only run .only test in this bdd suite', function() { | ||
it('should not run this test', function() { | ||
var zero = 0; | ||
zero.should.equal(1, 'this test should have been skipped'); | ||
(0).should.equal(1, 'this test should have been skipped'); | ||
}); | ||
it.only('should run this test', function() { | ||
var zero = 0; | ||
zero.should.equal(0, 'this .only test should run'); | ||
(0).should.equal(0, 'this .only test should run'); | ||
}); | ||
it('should run this test, not (includes the title of the .only test)', function() { | ||
var zero = 0; | ||
zero.should.equal(1, 'this test should have been skipped'); | ||
(0).should.equal(1, 'this test should have been skipped'); | ||
}); | ||
}); | ||
|
||
describe('should not run this suite', function() { | ||
it('should not run this test', function() { | ||
(true).should.equal(false); | ||
}); | ||
|
||
it('should not run this test', function() { | ||
(true).should.equal(false); | ||
}); | ||
|
||
it('should not run this test', function() { | ||
(true).should.equal(false); | ||
}); | ||
}); | ||
|
||
describe.only('should run all tests in this bdd suite', function() { | ||
it('should run this test #1', function() { | ||
(true).should.equal(true); | ||
}); | ||
|
||
it('should run this test #2', function() { | ||
(1).should.equal(1); | ||
}); | ||
|
||
it('should run this test #3', function() { | ||
('foo').should.equal('foo'); | ||
}); | ||
}); | ||
|
||
describe('should run only suites that marked as `only`', function() { | ||
describe.only('should run all this tdd suite', function() { | ||
it('should run this test #1', function() { | ||
(true).should.equal(true); | ||
}); | ||
|
||
it('should run this test #2', function() { | ||
(true).should.equal(true); | ||
}); | ||
}); | ||
|
||
describe('should not run this suite', function() { | ||
it('should run this test', function() { | ||
(true).should.equal(false); | ||
}); | ||
}); | ||
}); | ||
|
||
// Nested situation | ||
describe('should not run parent tests', function() { | ||
it('should not run this test', function() { | ||
(true).should.equal(false); | ||
}); | ||
describe('and not the child tests too', function() { | ||
it('should not run this test', function() { | ||
(true).should.equal(false); | ||
}); | ||
describe.only('but run all the tests in this suite', function() { | ||
it('should run this test #1', function() { | ||
(true).should.equal(true); | ||
}); | ||
it('should run this test #2', function() { | ||
(true).should.equal(true); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
// mark test as `only` override the suite behavior | ||
describe.only('should run only tests that marked as `only`', function() { | ||
it('should not run this test #1', function() { | ||
(false).should.equal(true); | ||
}); | ||
|
||
it.only('should run this test #2', function() { | ||
(true).should.equal(true); | ||
}); | ||
|
||
it('should not run this test #3', function() { | ||
(false).should.equal(true); | ||
}); | ||
|
||
it.only('should run this test #4', function() { | ||
(true).should.equal(true); | ||
}); | ||
}); | ||
|
||
describe.only('Should run only test cases that mark as only', function() { | ||
it.only('should runt his test', function() { | ||
(true).should.equal(true); | ||
}); | ||
|
||
it('should not run this test', function() { | ||
(false).should.equal(true); | ||
}); | ||
|
||
describe('should not run this suite', function() { | ||
it('should not run this test', function() { | ||
(false).should.equal(true); | ||
}); | ||
}); | ||
}); | ||
|
||
// Root Suite | ||
it.only('#Root-Suite, should run this test-case #1', function() { | ||
(true).should.equal(true); | ||
}); | ||
|
||
it.only('#Root-Suite, should run this test-case #2', function() { | ||
(true).should.equal(true); | ||
}); | ||
|
||
it('#Root-Suite, should not run this test', function() { | ||
(false).should.equal(true); | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
various places in this PR will need to be linted