You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/QUnit/test.skip.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,18 +16,16 @@ version_added: "1.16.0"
16
16
`QUnit.skip( name )`<br/>
17
17
`QUnit.skip( name, callback )`
18
18
19
-
Define a test that will be skipped during the run.
19
+
Define a test that will be skipped. Use this to disable a known broken or "flaky" test case.
20
20
21
21
| parameter | description |
22
22
|-----------|-------------|
23
23
|`name` (string) | Title of unit |
24
24
|`callback` (function) | Optional, function that would perform the test |
25
25
26
-
Use this method to disable a [`QUnit.test()`](./test.md), as alternative to commenting out the test.
26
+
The callback and any module hooks do not run for a skipped test. The name of your test will be included in results as a "skipped" test. This serves as a reminder to contributors. This is often preferred over the alternative of commenting out a test, because the code in the test will remain discoverable through static analysis and code search, and encourages inclusion during refactors and IDE automation.
27
27
28
-
This test will be listed in the results as a "skipped" test. The callback and the respective module's hooks will not run.
29
-
30
-
As a codebase becomes bigger, you may sometimes want to temporarily disable an entire group of tests at once. You can use [`QUnit.module.skip()`](./module.md) to recursively skip all tests in the same module.
28
+
In larger codebases, you may need to temporarily disable a group of tests at once. You can use [`QUnit.module.skip()`](./module.md) to recursively skip all tests in a module.
Copy file name to clipboardExpand all lines: docs/api/QUnit/test.todo.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ version_added: "2.2.0"
14
14
`QUnit.test.todo( name, callback )`<br>
15
15
`QUnit.todo( name, callback )`
16
16
17
-
Define a test that is not yet expected to pass, because the test has one or more failing assertions or throws an exception.
17
+
Define a test that is not yet expected to pass. Use this for tests of unfinished code.
18
18
19
19
| parameter | description |
20
20
|-----------|-------------|
@@ -27,11 +27,13 @@ Define a test that is not yet expected to pass, because the test has one or more
27
27
|-----------|-------------|
28
28
|`assert` (object) | A new instance object with the [assertion methods](../assert/index.md)|
29
29
30
-
Use this method to test a unit of code that is still under development (in a "todo" state). The "todo" test will pass as long as there is at least one assertion still failing, or if an exception is thrown.
30
+
In [test-driven development](https://en.wikipedia.org/wiki/Test-driven_development), you can specify how code should work with tests, and then work towards making these tests pass. When collaborating in a larger project, you can share tests for unfinished features as "todo" tests so that CI passes while your feature is under development. You can also use this method to disable a known broken test, where the code may be working but the test is incomplete.
31
31
32
-
When all assertions are passing, the "todo" test will fail, thus signaling that `QUnit.test.todo()` should be changed to [`QUnit.test()`](./test.md).
32
+
"Todo" tests will pass as long as there is at least one assertion still failing, or if an exception is thrown.
33
33
34
-
You can also use [`QUnit.module.todo()`](./module.md) to manage the "todo" state for all tests within a module at once.
34
+
Once all assertions are passing, the "todo" test will fail, thus reminding you that `QUnit.test.todo()` should be changed to [`QUnit.test()`](./test.md). If a test should be skipped unconditionally, use [`QUnit.test.skip()`](./test.skip.md) instead.
35
+
36
+
You can use [`QUnit.module.todo()`](./module.md) to manage the "todo" state for all tests within a module at once.
0 commit comments