Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Apr 29, 2020
1 parent 8d446de commit bfe684c
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ setTimeout(function() {

### Failing Hooks

Upon a failing `before` hook all tests in the current suite and also its nested suites will be skipped. Skipped tests are included in the test results and marked as **skipped**. A skipped test is not considered a failed test.
Upon a failing "before all", "before each" or "after each" hook, all remaining tests in the current suite and also its nested suites will be skipped. Skipped tests are included in the test results and marked as **skipped**. A skipped test is not considered a failed test.

```js
describe('outer', function() {
Expand Down Expand Up @@ -481,6 +481,34 @@ describe('outer', function() {
});
```

```js
describe('failing "before each" hook', function() {
beforeEach(function() {
// runs and fails only once
throw new Error('Exception in beforeEach hook');
});

it('should skip this outer test', function() {
// will be skipped and reported as 'skipped' test
});

afterEach(function() {}); // will be executed
after(function() {}); // will be executed

describe('inner suite', function() {
before(function() {}); // will be skipped
beforeEach(function() {}); // will be skipped

it('should skip this inner test', function() {
// will be skipped and reported as 'skipped' test
});

afterEach(function() {}); // will be skipped
after(function() {}); // will be skipped
});
});
```

## Pending Tests

"Pending" - as in "someone should write these test cases eventually" - test-cases are simply those _without_ a callback:
Expand Down

0 comments on commit bfe684c

Please sign in to comment.