Skip to content
Permalink
Browse files

Fix typo in the docs for writing tests (#2265)

  • Loading branch information...
HeathNaylor authored and sindresorhus committed Oct 8, 2019
1 parent dc2c4ef commit 7b54317b5cf2d4a849fe784a1b946f5c2159be8e
Showing with 1 addition and 1 deletion.
  1. +1 −1 docs/01-writing-tests.md
@@ -163,7 +163,7 @@ AVA lets you register hooks that are run before and after your tests. This allow

`test.before()` registers a hook to be run before the first test in your test file. Similarly `test.after()` registers a hook to be run after the last test. Use `test.after.always()` to register a hook that will **always** run once your tests and other hooks complete. `.always()` hooks run regardless of whether there were earlier failures, so they are ideal for cleanup tasks. Note however that uncaught exceptions, unhandled rejections or timeouts will crash your tests, possibly preventing `.always()` hooks from running.

`test.beforeEach()` registers a hook to be run before each test in your test file. Similarly `test.afterEach()` a hook to be run after each test. Use `test.afterEach.always()` to register an after hook that is called even if other test hooks, or the test itself, fail.
`test.beforeEach()` registers a hook to be run before each test in your test file. Similarly `test.afterEach()` registers a hook to be run after each test. Use `test.afterEach.always()` to register an after hook that is called even if other test hooks, or the test itself, fail.

If a test is skipped with the `.skip` modifier, the respective `.beforeEach()`, `.afterEach()` and `.afterEach.always()` hooks are not run. Likewise, if all tests in a test file are skipped `.before()`, `.after()` and `.after.always()` hooks for the file are not run.

0 comments on commit 7b54317

Please sign in to comment.
You can’t perform that action at this time.