From 9c5c25466a093fc46dc335e10b8b53a8a4cdb73f Mon Sep 17 00:00:00 2001 From: cgcgbcbc Date: Mon, 23 May 2016 17:33:04 +0800 Subject: [PATCH 1/3] document always hook with fail fast flag resolve #820 --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index ad3656312..2863868dd 100644 --- a/readme.md +++ b/readme.md @@ -436,6 +436,8 @@ AVA lets you register hooks that are run before and after your tests. This allow `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. `.always()` hooks are ideal for cleanup tasks. +**Note**: if `--fail-fast` flag is provided, ava will stop after first test failure and `.always` hook will **NOT** run. + Like `test()` these methods take an optional title and a callback function. The title is shown if your hook fails to execute. The callback is called with an [execution object](#t). `before` hooks execute before `beforeEach` hooks. `afterEach` hooks execute before `after` hooks. Within their category the hooks execute in the order they were defined. From 6e04ecfe7ef3c993e9ea326d34d55a2370571b6d Mon Sep 17 00:00:00 2001 From: cgcgbcbc Date: Mon, 23 May 2016 17:40:07 +0800 Subject: [PATCH 2/3] improve writing --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 2863868dd..b436b6a80 100644 --- a/readme.md +++ b/readme.md @@ -436,7 +436,8 @@ AVA lets you register hooks that are run before and after your tests. This allow `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. `.always()` hooks are ideal for cleanup tasks. -**Note**: if `--fail-fast` flag is provided, ava will stop after first test failure and `.always` hook will **NOT** run. +**Note**: If the `--fail-fast` flag is specified, AVA will stop after the first test failure and the `.always` hook will **not** run. + Like `test()` these methods take an optional title and a callback function. The title is shown if your hook fails to execute. The callback is called with an [execution object](#t). From fb68c69ad765ec60333ae3b7fd5136cc0b3a31f1 Mon Sep 17 00:00:00 2001 From: cgcgbcbc Date: Mon, 23 May 2016 17:43:03 +0800 Subject: [PATCH 3/3] remove useless empty line --- readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/readme.md b/readme.md index b436b6a80..49f81bf05 100644 --- a/readme.md +++ b/readme.md @@ -438,7 +438,6 @@ AVA lets you register hooks that are run before and after your tests. This allow **Note**: If the `--fail-fast` flag is specified, AVA will stop after the first test failure and the `.always` hook will **not** run. - Like `test()` these methods take an optional title and a callback function. The title is shown if your hook fails to execute. The callback is called with an [execution object](#t). `before` hooks execute before `beforeEach` hooks. `afterEach` hooks execute before `after` hooks. Within their category the hooks execute in the order they were defined.