Skip to content

Commit

Permalink
Merge pull request #85 from Testy/focus-ignore
Browse files Browse the repository at this point in the history
Focus ignore
  • Loading branch information
Aboisier authored Jul 22, 2021
2 parents 5d1b085 + e51358c commit a40648e
Show file tree
Hide file tree
Showing 24 changed files with 1,490 additions and 1,201 deletions.
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# Changes

## 2.0.0-beta.3

### Fixes

- Fixed issue with the `XTestSuite`. It did not ignore tests, now it does.

### Improvements

- Added a new way of focusing/ignoring tests. Instead of focusing tests using the `@FTest()` decorator, it is now possible to simply use the `@Test.focus()` method. Symetrically, it is possible to ignore tests by doing `@Test.ignore()`. This also works for test suites.

## 2.0.0-beta.2

### Improvements

- Improved logging (failed test suites now display the stacktrace, more color and bold were added) _(#79, thanks for the suggestion, #geon!)_

## 2.0.0-beta.1
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ expect.toBeSorted.inAscendingOrder([0, 1, 1, 2, 3, 5, 8]);
You can ignore tests by adding an `X` before a test suite or a specific test decorator. Ignored tests will still show up in the test report, but they will be marked as ignored.

```ts
@XTestSuite() // This test suite will be ignored
@TestSuite.ignore() // This test suite will be ignored
export class MyTestSuite {
// Your tests
}

@TestSuite()
export class MyTestSuite {
@XTest() // This test will be ignored
@Test.ignore() // This test will be ignored
onePlusOne() {
// Some test
}
Expand All @@ -188,15 +188,15 @@ export class MyTestSuite {
You can also focus tests by adding an `F` before a test suite or a specific test decorator. If one test or test suites are focused, only those will be runned. The others will be reported as ignored.

```ts
@FTestSuite() // This test suite will be focused.
@TestSuite.focus() // This test suite will be focused.
export class MyTestSuite {
...
}

@TestSuite()
export class MyTestSuite {

@FTest() // This test will be focused
@Test.focus() // This test will be focused
onePlusOne() {
// Your test
}
Expand Down
8 changes: 8 additions & 0 deletions e2e/focus/.expected_stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Root
# TestSuite1
ok 1 test1 # SKIP
ok 2 test2
# TestSuite2
ok 3 test1 # SKIP
ok 4 test2
1..2
1 change: 1 addition & 0 deletions e2e/focus/.runner_command
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test -- -r TAP
Loading

0 comments on commit a40648e

Please sign in to comment.