Commit 079d054
committed
test: simplify test-async-hooks-http-parser-destroy
Simplify test-async-hooks-http-parser-destroy and improve it's reporting
when failing. (Also makes it easier to run on older versions of Node.js
because it doesn't rely on internal test modules that won't work there.)
Before, failures looked like this (edited slightly to conform to our
commit message 72-char line length restriction):
The expression evaluated to a falsy value:
assert.ok(destroyedIds.indexOf(createdAsyncId) >= 0)
Now, you get a slightly better idea of what's up. (Is it missing one ID?
More than one? All of them?):
Input A expected to strictly deep-equal input B:
+ expected - actual ... Lines skipped
Set {
1009,
...
1025,
- 158,
- 159,
- 161,
- 162,
- 164,
- 165,
- 167,
- 168,
- 170,
...
+ 159,
+ 162,
+ 165,
+ 168,
+ 171,
+ 174,
+ 177,
+ 180,
+ 183,
This test still fails as expected on 10.14.1 and passees on 10.14.2
(where the regression it tests for was fixed). (You will need to comment
on the `require('../common');` line first but that's now the only change
you need to make this run in older versions.)
Refs: #266101 parent 2e4ceb5 commit 079d054
1 file changed
+40
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | | - | |
| 20 | + | |
19 | 21 | | |
20 | | - | |
| 22 | + | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 42 | + | |
50 | 43 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
60 | 48 | | |
61 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
0 commit comments