Skip to content

Commit 96ca955

Browse files
author
Isaac Shapira
committed
Merge pull request #9 from felixSchl/feature-async-before-after
Add async versions of before and after hooks
2 parents 95da915 + 54d29d4 commit 96ca955

2 files changed

Lines changed: 279 additions & 75 deletions

File tree

README.md

Lines changed: 167 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,193 @@
66

77
## Module Test.Mocha
88

9-
### Types
9+
#### `Before`
1010

11-
data After :: !
11+
``` purescript
12+
data Before :: !
13+
```
1214

13-
data Before :: !
1415

15-
data Describe :: !
16+
#### `Describe`
1617

17-
type DoDescribe = forall e a. String -> Eff e a -> Eff (describe :: Describe | e) Unit
18+
``` purescript
19+
data Describe :: !
20+
```
1821

19-
type DoIt = forall e a. String -> Eff e a -> Eff (it :: It | e) Unit
2022

21-
data Done :: !
23+
#### `It`
2224

23-
data DoneToken where
24-
DoneToken :: DoneToken
25+
``` purescript
26+
data It :: !
27+
```
2528

26-
data It :: !
2729

30+
#### `After`
2831

29-
### Values
32+
``` purescript
33+
data After :: !
34+
```
3035

31-
after :: forall e a. Eff e a -> Eff (after :: After | e) Unit
3236

33-
afterEach :: forall e a. Eff e a -> Eff (after :: After | e) Unit
37+
#### `Done`
3438

35-
before :: forall e a. Eff e a -> Eff (before :: Before | e) Unit
39+
``` purescript
40+
data Done :: !
41+
```
3642

37-
beforeEach :: forall e a. Eff e a -> Eff (before :: Before | e) Unit
3843

39-
describe :: DoDescribe
44+
#### `DoIt`
4045

41-
describeOnly :: DoDescribe
46+
``` purescript
47+
type DoIt = forall e a. String -> Eff e a -> Eff (it :: It | e) Unit
48+
```
4249

43-
describeSkip :: DoDescribe
4450

45-
it :: DoIt
51+
#### `DoDescribe`
4652

47-
itAsync :: forall a eff. String -> (DoneToken -> Eff (done :: Done | eff) a) -> Eff (it :: It | eff) Unit
53+
``` purescript
54+
type DoDescribe = forall e a. String -> Eff (describe :: Describe | e) a -> Eff (describe :: Describe | e) Unit
55+
```
4856

49-
itIs :: forall eff. DoneToken -> Eff (done :: Done | eff) Unit
5057

51-
itIsNot :: forall eff. DoneToken -> Eff (done :: Done | eff) Unit
58+
#### `DoBefore`
5259

53-
itOnly :: DoIt
60+
``` purescript
61+
type DoBefore = forall e a. Eff e a -> Eff (before :: Before | e) Unit
62+
```
5463

55-
itSkip :: DoIt
64+
65+
#### `DoAfter`
66+
67+
``` purescript
68+
type DoAfter = forall e a. Eff e a -> Eff (after :: After | e) Unit
69+
```
70+
71+
72+
#### `DoneToken`
73+
74+
``` purescript
75+
data DoneToken
76+
= DoneToken
77+
```
78+
79+
80+
#### `describe`
81+
82+
``` purescript
83+
describe :: DoDescribe
84+
```
85+
86+
87+
#### `describeOnly`
88+
89+
``` purescript
90+
describeOnly :: DoDescribe
91+
```
92+
93+
94+
#### `describeSkip`
95+
96+
``` purescript
97+
describeSkip :: DoDescribe
98+
```
99+
100+
101+
#### `it`
102+
103+
``` purescript
104+
it :: DoIt
105+
```
106+
107+
108+
#### `itOnly`
109+
110+
``` purescript
111+
itOnly :: DoIt
112+
```
113+
114+
115+
#### `itSkip`
116+
117+
``` purescript
118+
itSkip :: DoIt
119+
```
120+
121+
122+
#### `itAsync`
123+
124+
``` purescript
125+
itAsync :: forall a eff. String -> (DoneToken -> Eff (done :: Done | eff) a) -> Eff (it :: It | eff) Unit
126+
```
127+
128+
129+
#### `itIs`
130+
131+
``` purescript
132+
itIs :: forall eff. DoneToken -> Eff (done :: Done | eff) Unit
133+
```
134+
135+
136+
#### `itIsNot`
137+
138+
``` purescript
139+
itIsNot :: forall eff a. DoneToken -> Eff (done :: Done | eff) Unit
140+
```
141+
142+
143+
#### `before`
144+
145+
``` purescript
146+
before :: DoBefore
147+
```
148+
149+
Before Hooks
150+
151+
#### `beforeEach`
152+
153+
``` purescript
154+
beforeEach :: DoBefore
155+
```
156+
157+
158+
#### `beforeAsync`
159+
160+
``` purescript
161+
beforeAsync :: forall a eff. (DoneToken -> Eff (done :: Done | eff) a) -> Eff (it :: It | eff) Unit
162+
```
163+
164+
165+
#### `beforeEachAsync`
166+
167+
``` purescript
168+
beforeEachAsync :: forall a eff. (DoneToken -> Eff (done :: Done | eff) a) -> Eff (it :: It | eff) Unit
169+
```
170+
171+
172+
#### `after`
173+
174+
``` purescript
175+
after :: DoAfter
176+
```
177+
178+
After Hooks
179+
180+
#### `afterEach`
181+
182+
``` purescript
183+
afterEach :: DoAfter
184+
```
185+
186+
187+
#### `afterAsync`
188+
189+
``` purescript
190+
afterAsync :: forall a eff. (DoneToken -> Eff (done :: Done | eff) a) -> Eff (it :: It | eff) Unit
191+
```
192+
193+
194+
#### `afterEachAsync`
195+
196+
``` purescript
197+
afterEachAsync :: forall a eff. (DoneToken -> Eff (done :: Done | eff) a) -> Eff (it :: It | eff) Unit
198+
```

0 commit comments

Comments
 (0)