-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[WIP] A way to submit tests that should fail. #831
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
Merged
novemberborn
merged 11 commits into
avajs:master
from
cgcgbcbc:673-submit-tests-should-fail
May 16, 2016
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e107a3c
add failing metadata
cgcgbcbc e8ab228
flip Test._result when failing=true
cgcgbcbc 2413594
add tests for verifying failing worked for callback
cgcgbcbc fa32209
add tests verifying failing test fail if passed
cgcgbcbc 25b4979
add tests for failing test returns a resolved promise
cgcgbcbc 7d10392
add tests for failing test returns a rejected promise
cgcgbcbc 98e43e4
add tests for failing test with t.throws
cgcgbcbc a12227e
fix test
cgcgbcbc 2378a44
fix test title
cgcgbcbc c4d1306
update readme about failing modifier
cgcgbcbc 4ac5ebe
update readme
cgcgbcbc 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 hidden or 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 |
---|---|---|
|
@@ -415,6 +415,16 @@ You can use the `.todo` modifier when you're planning to write a test. Like skip | |
test.todo('will think about writing this later'); | ||
``` | ||
|
||
### Failing tests | ||
|
||
You can use the `.failing` modifier for submitting tests that are intended to be failures without killing CI process. And if the failing test does pass, it will fail, and it will remind you remove the failing modifier. | ||
|
||
```js | ||
test.failing('this test prove something wrong', t => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. People should link to the relevant issue. We should model that behavior in the docs. Also, a bit of language/style cleanup. // See: github.com/user/repo/issues/1234
test.failing('demonstrate some bug', t => {
t.fail(); // test will count as passed
}); |
||
t.fail(); | ||
}); // will count as passed test | ||
``` | ||
|
||
### Before & after hooks | ||
|
||
AVA lets you register hooks that are run before and after your tests. This allows you to run setup and/or teardown code. | ||
|
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.
I would like to expand on this a bit: