This repository was archived by the owner on May 29, 2019. It is now read-only.
Commit 0aecd89
Miroslav Bajtoš
helpers: fix usage of mocha contexts
Mocha 1.19 introduced nested contexts, where each `describe` has its
own context inheriting from parent's context via prototype.
The helper `whenCalledRemotely` was reading `this.url` to allow
users to override the url. However, since `whenCalledRemotely` was
not clearing `this.url` properly at the end of the test, the override
worked for the first request only. Subsequent requests used the same
URL as provided in the helper parameters.
This commit fixes the problem by changing `this.url = undefined`
to `delete this.url`, so that the the sub-sequent calls can access
`this.__proto__.url` in the same way as the first call.1 parent 12d3bad commit 0aecd89
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments