-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
hooks.ts
36 lines (32 loc) · 926 Bytes
/
hooks.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import {
After,
AfterAll,
AfterStep,
Before,
BeforeAll,
BeforeStep,
ITestCaseHookParameter,
ITestStepHookParameter,
} from '../'
// should allow argument-less hooks
BeforeAll(function () {})
AfterAll(function () {})
Before(function () {})
After(function () {})
BeforeStep(function () {})
AfterStep(function () {})
// should allow typed arguments in hooks
Before(function (param: ITestCaseHookParameter) {})
After(function (param: ITestCaseHookParameter) {})
BeforeStep(function (param: ITestStepHookParameter) {})
AfterStep(function (param: ITestStepHookParameter) {})
// should allow an object with tags and/or name in hooks
Before({ tags: '@foo', name: 'before hook' }, function () {})
After({ tags: '@foo', name: 'after hook' }, function () {})
// should allow us to return 'skipped' from a test case hook
Before(async function () {
return 'skipped'
})
After(async function () {
return 'skipped'
})