Skip to content

Commit 1512e10

Browse files
committed
added tests
1 parent 091b0a9 commit 1512e10

File tree

3 files changed

+299
-1
lines changed

3 files changed

+299
-1
lines changed

test/message/test_runner_output_spec_reporter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ const child = spawn(process.execPath,
66
['--no-warnings', '--test-reporter', 'spec', 'test/message/test_runner_output.js'],
77
{ stdio: 'pipe' });
88
// eslint-disable-next-line no-control-regex
9-
child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, '')));
9+
child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, '').replace(/[^\x00-\x7c]/g, '')));
1010
child.stderr.pipe(process.stderr);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Flags: --no-warnings
2+
'use strict';
3+
require('../common');
4+
const spawn = require('node:child_process').spawn;
5+
const child = spawn(process.execPath,
6+
['--no-warnings', '--test-reporter', 'spec',
7+
'--experimental-test-coverage', 'test/message/test_runner_output.js'],
8+
{ stdio: 'pipe' });
9+
// eslint-disable-next-line no-control-regex
10+
child.stdout.on('data', (d) => process.stdout.write(d.toString().replace(/[^\x00-\x7F]/g, '').replace(/\u001b\[\d+m/g, '')));
11+
child.stderr.pipe(process.stderr);
Lines changed: 287 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,287 @@
1+
sync pass todo (*ms)
2+
sync pass todo with message (*ms)
3+
sync fail todo (*ms)
4+
Error: thrown from sync fail todo
5+
*
6+
*
7+
*
8+
*
9+
*
10+
*
11+
*
12+
13+
sync fail todo with message (*ms)
14+
Error: thrown from sync fail todo with message
15+
*
16+
*
17+
*
18+
*
19+
*
20+
*
21+
*
22+
23+
sync skip pass (*ms)
24+
sync skip pass with message (*ms)
25+
sync pass (*ms)
26+
this test should pass
27+
sync throw fail (*ms)
28+
Error: thrown from sync throw fail
29+
*
30+
*
31+
*
32+
*
33+
*
34+
*
35+
*
36+
37+
async skip pass (*ms)
38+
async pass (*ms)
39+
async throw fail (*ms)
40+
Error: thrown from async throw fail
41+
*
42+
*
43+
*
44+
*
45+
*
46+
*
47+
*
48+
49+
async skip fail (*ms)
50+
Error: thrown from async throw fail
51+
*
52+
*
53+
*
54+
*
55+
*
56+
*
57+
*
58+
59+
async assertion fail (*ms)
60+
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
61+
62+
true !== false
63+
64+
*
65+
*
66+
*
67+
*
68+
*
69+
*
70+
* {
71+
generatedMessage: true,
72+
code: 'ERR_ASSERTION',
73+
actual: true,
74+
expected: false,
75+
operator: 'strictEqual'
76+
}
77+
78+
resolve pass (*ms)
79+
reject fail (*ms)
80+
Error: rejected from reject fail
81+
*
82+
*
83+
*
84+
*
85+
*
86+
*
87+
*
88+
89+
unhandled rejection - passes but warns (*ms)
90+
async unhandled rejection - passes but warns (*ms)
91+
immediate throw - passes but warns (*ms)
92+
immediate reject - passes but warns (*ms)
93+
immediate resolve pass (*ms)
94+
subtest sync throw fail
95+
+sync throw fail (*ms)
96+
Error: thrown from subtest sync throw fail
97+
*
98+
*
99+
*
100+
*
101+
*
102+
*
103+
*
104+
*
105+
*
106+
*
107+
108+
this subtest should make its parent test fail
109+
subtest sync throw fail (*ms)
110+
111+
sync throw non-error fail (*ms)
112+
Symbol(thrown symbol from sync throw non-error fail)
113+
114+
level 0a
115+
level 1a (*ms)
116+
level 1b (*ms)
117+
level 1c (*ms)
118+
level 1d (*ms)
119+
level 0a (*ms)
120+
121+
top level
122+
+long running (*ms)
123+
'test did not finish before its parent and was cancelled'
124+
125+
+short running
126+
++short running (*ms)
127+
+short running (*ms)
128+
129+
top level (*ms)
130+
131+
invalid subtest - pass but subtest fails (*ms)
132+
sync skip option (*ms)
133+
sync skip option with message (*ms)
134+
sync skip option is false fail (*ms)
135+
Error: this should be executed
136+
*
137+
*
138+
*
139+
*
140+
*
141+
*
142+
*
143+
144+
<anonymous> (*ms)
145+
functionOnly (*ms)
146+
<anonymous> (*ms)
147+
test with only a name provided (*ms)
148+
<anonymous> (*ms)
149+
<anonymous> (*ms)
150+
test with a name and options provided (*ms)
151+
functionAndOptions (*ms)
152+
escaped description \ # *
153+
*
154+
(*ms)
155+
escaped skip message (*ms)
156+
escaped todo message (*ms)
157+
escaped diagnostic (*ms)
158+
#diagnostic
159+
callback pass (*ms)
160+
callback fail (*ms)
161+
Error: callback failure
162+
*
163+
*
164+
165+
sync t is this in test (*ms)
166+
async t is this in test (*ms)
167+
callback t is this in test (*ms)
168+
callback also returns a Promise (*ms)
169+
'passed a callback but also returned a Promise'
170+
171+
callback throw (*ms)
172+
Error: thrown from callback throw
173+
*
174+
*
175+
*
176+
*
177+
*
178+
*
179+
*
180+
181+
callback called twice (*ms)
182+
'callback invoked multiple times'
183+
184+
callback called twice in different ticks (*ms)
185+
callback called twice in future tick (*ms)
186+
Error [ERR_TEST_FAILURE]: callback invoked multiple times
187+
*
188+
failureType: 'multipleCallbackInvocations',
189+
cause: 'callback invoked multiple times',
190+
code: 'ERR_TEST_FAILURE'
191+
}
192+
193+
callback async throw (*ms)
194+
Error: thrown from callback async throw
195+
*
196+
*
197+
198+
callback async throw after done (*ms)
199+
only is set but not in only mode
200+
running subtest 1 (*ms)
201+
running subtest 2 (*ms)
202+
running subtest 3 (*ms)
203+
running subtest 4 (*ms)
204+
only is set but not in only mode (*ms)
205+
206+
custom inspect symbol fail (*ms)
207+
customized
208+
209+
custom inspect symbol that throws fail (*ms)
210+
{ foo: 1, [Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]] }
211+
212+
subtest sync throw fails
213+
sync throw fails at first (*ms)
214+
Error: thrown from subtest sync throw fails at first
215+
*
216+
*
217+
*
218+
*
219+
*
220+
*
221+
*
222+
*
223+
*
224+
*
225+
226+
sync throw fails at second (*ms)
227+
Error: thrown from subtest sync throw fails at second
228+
*
229+
*
230+
*
231+
*
232+
*
233+
*
234+
*
235+
*
236+
*
237+
*
238+
239+
subtest sync throw fails (*ms)
240+
241+
timed out async test (*ms)
242+
'test timed out after *ms'
243+
244+
timed out callback test (*ms)
245+
'test timed out after *ms'
246+
247+
large timeout async test is ok (*ms)
248+
large timeout callback test is ok (*ms)
249+
successful thenable (*ms)
250+
rejected thenable (*ms)
251+
'custom error'
252+
253+
unfinished test with uncaughtException (*ms)
254+
Error: foo
255+
*
256+
*
257+
*
258+
259+
unfinished test with unhandledRejection (*ms)
260+
Error: bar
261+
*
262+
*
263+
*
264+
265+
invalid subtest fail (*ms)
266+
'test could not be started because its parent finished'
267+
268+
Warning: Test "unhandled rejection - passes but warns" generated asynchronous activity after the test ended. This activity created the error "Error: rejected from unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event.
269+
Warning: Test "async unhandled rejection - passes but warns" generated asynchronous activity after the test ended. This activity created the error "Error: rejected from async unhandled rejection fail" and would have caused the test to fail, but instead triggered an unhandledRejection event.
270+
Warning: Test "immediate throw - passes but warns" generated asynchronous activity after the test ended. This activity created the error "Error: thrown from immediate throw fail" and would have caused the test to fail, but instead triggered an uncaughtException event.
271+
Warning: Test "immediate reject - passes but warns" generated asynchronous activity after the test ended. This activity created the error "Error: rejected from immediate reject fail" and would have caused the test to fail, but instead triggered an unhandledRejection event.
272+
Warning: Test "callback called twice in different ticks" generated asynchronous activity after the test ended. This activity created the error "Error [ERR_TEST_FAILURE]: callback invoked multiple times" and would have caused the test to fail, but instead triggered an uncaughtException event.
273+
Warning: Test "callback async throw after done" generated asynchronous activity after the test ended. This activity created the error "Error: thrown from callback async throw after done" and would have caused the test to fail, but instead triggered an uncaughtException event.
274+
tests 65
275+
pass 27
276+
fail 21
277+
cancelled 2
278+
skipped 10
279+
todo 5
280+
duration_ms *
281+
start of coverage report
282+
*
283+
*
284+
*
285+
*
286+
*
287+
end of coverage report

0 commit comments

Comments
 (0)