Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli/tools/test): Show Deno.test() call locations for failures #14484

Merged
merged 2 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions cli/tests/testdata/compat/test_runner/cjs.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Failed assertion ... FAILED ([WILDCARD])

failures:

./compat/test_runner/cjs.js > Failed assertion
AssertionError: Values are not strictly equal:
Failed assertion => ./compat/test_runner/cjs.js:[WILDCARD]
error: AssertionError: Values are not strictly equal:


[Diff] Actual / Expected
Expand All @@ -20,8 +20,7 @@ AssertionError: Values are not strictly equal:

failures:

./compat/test_runner/cjs.js
Failed assertion
Failed assertion => ./compat/test_runner/cjs.js:[WILDCARD]

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])

Expand Down
7 changes: 3 additions & 4 deletions cli/tests/testdata/compat/test_runner/esm.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Failed assertion ... FAILED ([WILDCARD])

failures:

./compat/test_runner/esm.mjs > Failed assertion
AssertionError: Values are not strictly equal:
Failed assertion => ./compat/test_runner/esm.mjs:[WILDCARD]
error: AssertionError: Values are not strictly equal:


[Diff] Actual / Expected
Expand All @@ -20,8 +20,7 @@ AssertionError: Values are not strictly equal:

failures:

./compat/test_runner/esm.mjs
Failed assertion
Failed assertion => ./compat/test_runner/esm.mjs:[WILDCARD]

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])

Expand Down
7 changes: 3 additions & 4 deletions cli/tests/testdata/test/aggregate_error.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ aggregate ... FAILED ([WILDCARD])

failures:

./test/aggregate_error.ts > aggregate
AggregateError
aggregate => ./test/aggregate_error.ts:[WILDCARD]
error: AggregateError
Error: Error 1
at [WILDCARD]/testdata/test/aggregate_error.ts:2:18
Error: Error 2
Expand All @@ -15,8 +15,7 @@ AggregateError

failures:

./test/aggregate_error.ts
aggregate
aggregate => ./test/aggregate_error.ts:[WILDCARD]

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])

Expand Down
43 changes: 21 additions & 22 deletions cli/tests/testdata/test/allow_none.out
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,42 @@ hrtime ... FAILED [WILDCARD]

failures:

./test/allow_none.ts > read
PermissionDenied: Can't escalate parent thread permissions
read => ./test/allow_none.ts:[WILDCARD]
error: PermissionDenied: Can't escalate parent thread permissions
[WILDCARD]

./test/allow_none.ts > write
PermissionDenied: Can't escalate parent thread permissions
write => ./test/allow_none.ts:[WILDCARD]
error: PermissionDenied: Can't escalate parent thread permissions
[WILDCARD]

./test/allow_none.ts > net
PermissionDenied: Can't escalate parent thread permissions
net => ./test/allow_none.ts:[WILDCARD]
error: PermissionDenied: Can't escalate parent thread permissions
[WILDCARD]

./test/allow_none.ts > env
PermissionDenied: Can't escalate parent thread permissions
env => ./test/allow_none.ts:[WILDCARD]
error: PermissionDenied: Can't escalate parent thread permissions
[WILDCARD]

./test/allow_none.ts > run
PermissionDenied: Can't escalate parent thread permissions
run => ./test/allow_none.ts:[WILDCARD]
error: PermissionDenied: Can't escalate parent thread permissions
[WILDCARD]

./test/allow_none.ts > ffi
PermissionDenied: Can't escalate parent thread permissions
ffi => ./test/allow_none.ts:[WILDCARD]
error: PermissionDenied: Can't escalate parent thread permissions
[WILDCARD]

./test/allow_none.ts > hrtime
PermissionDenied: Can't escalate parent thread permissions
hrtime => ./test/allow_none.ts:[WILDCARD]
error: PermissionDenied: Can't escalate parent thread permissions
[WILDCARD]

failures:

./test/allow_none.ts
read
write
net
env
run
ffi
hrtime
read => ./test/allow_none.ts:[WILDCARD]
write => ./test/allow_none.ts:[WILDCARD]
net => ./test/allow_none.ts:[WILDCARD]
env => ./test/allow_none.ts:[WILDCARD]
run => ./test/allow_none.ts:[WILDCARD]
ffi => ./test/allow_none.ts:[WILDCARD]
hrtime => ./test/allow_none.ts:[WILDCARD]

test result: FAILED. 0 passed; 7 failed; 0 ignored; 0 measured; 0 filtered out [WILDCARD]
19 changes: 9 additions & 10 deletions cli/tests/testdata/test/exit_sanitizer.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,32 @@ exit(2) ... FAILED ([WILDCARD])

failures:

./test/exit_sanitizer.ts > exit(0)
AssertionError: Test case attempted to exit with exit code: 0
exit(0) => ./test/exit_sanitizer.ts:[WILDCARD]
error: AssertionError: Test case attempted to exit with exit code: 0
Deno.exit(0);
^
at [WILDCARD]
at [WILDCARD]/test/exit_sanitizer.ts:2:8

./test/exit_sanitizer.ts > exit(1)
AssertionError: Test case attempted to exit with exit code: 1
exit(1) => ./test/exit_sanitizer.ts:[WILDCARD]
error: AssertionError: Test case attempted to exit with exit code: 1
Deno.exit(1);
^
at [WILDCARD]
at [WILDCARD]/test/exit_sanitizer.ts:6:8

./test/exit_sanitizer.ts > exit(2)
AssertionError: Test case attempted to exit with exit code: 2
exit(2) => ./test/exit_sanitizer.ts:[WILDCARD]
error: AssertionError: Test case attempted to exit with exit code: 2
bartlomieju marked this conversation as resolved.
Show resolved Hide resolved
Deno.exit(2);
^
at [WILDCARD]
at [WILDCARD]/test/exit_sanitizer.ts:10:8

failures:

./test/exit_sanitizer.ts
exit(0)
exit(1)
exit(2)
exit(0) => ./test/exit_sanitizer.ts:[WILDCARD]
exit(1) => ./test/exit_sanitizer.ts:[WILDCARD]
exit(2) => ./test/exit_sanitizer.ts:[WILDCARD]

test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])

Expand Down
61 changes: 30 additions & 31 deletions cli/tests/testdata/test/fail.out
Original file line number Diff line number Diff line change
Expand Up @@ -13,79 +13,78 @@ test 9 ... FAILED ([WILDCARD])

failures:

./test/fail.ts > test 0
Error
test 0 => ./test/fail.ts:1:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:2:9

./test/fail.ts > test 1
Error
test 1 => ./test/fail.ts:4:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:5:9

./test/fail.ts > test 2
Error
test 2 => ./test/fail.ts:7:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:8:9

./test/fail.ts > test 3
Error
test 3 => ./test/fail.ts:10:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:11:9

./test/fail.ts > test 4
Error
test 4 => ./test/fail.ts:13:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:14:9

./test/fail.ts > test 5
Error
test 5 => ./test/fail.ts:16:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:17:9

./test/fail.ts > test 6
Error
test 6 => ./test/fail.ts:19:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:20:9

./test/fail.ts > test 7
Error
test 7 => ./test/fail.ts:22:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:23:9

./test/fail.ts > test 8
Error
test 8 => ./test/fail.ts:25:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:26:9

./test/fail.ts > test 9
Error
test 9 => ./test/fail.ts:28:6
error: Error
throw new Error();
^
at [WILDCARD]/test/fail.ts:29:9

failures:

./test/fail.ts
test 0
test 1
test 2
test 3
test 4
test 5
test 6
test 7
test 8
test 9
test 0 => ./test/fail.ts:1:6
test 1 => ./test/fail.ts:4:6
test 2 => ./test/fail.ts:7:6
test 3 => ./test/fail.ts:10:6
test 4 => ./test/fail.ts:13:6
test 5 => ./test/fail.ts:16:6
test 6 => ./test/fail.ts:19:6
test 7 => ./test/fail.ts:22:6
test 8 => ./test/fail.ts:25:6
test 9 => ./test/fail.ts:28:6

test result: FAILED. 0 passed; 10 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])

Expand Down
7 changes: 3 additions & 4 deletions cli/tests/testdata/test/fail_fast.out
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ test 1 ... FAILED ([WILDCARD])

failures:

./test/fail_fast.ts > test 1
Error
test 1 => ./test/fail_fast.ts:[WILDCARD]
error: Error
throw new Error();
^
at [WILDCARD]/test/fail_fast.ts:2:9

failures:

./test/fail_fast.ts
test 1
test 1 => ./test/fail_fast.ts:[WILDCARD]

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])

Expand Down
12 changes: 6 additions & 6 deletions cli/tests/testdata/test/fail_fast_with_val.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ test test 2 ... FAILED ([WILDCARD])

failures:

test 1
Error
test 1 => ./test/fail_fast_with_val.ts:[WILDCARD]
error: Error
at [WILDCARD]/test/fail_fast_with_val.ts:2:9
at [WILDCARD]

test 2
Error
test 2 => ./test/fail_fast_with_val.ts:[WILDCARD]
error: Error
at [WILDCARD]/test/fail_fast_with_val.ts:5:9
at [WILDCARD]

failures:

test 1
test 2
test 1 => ./test/fail_fast_with_val.ts:[WILDCARD]
test 2 => ./test/fail_fast_with_val.ts:[WILDCARD]

test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])
7 changes: 3 additions & 4 deletions cli/tests/testdata/test/finally_timeout.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ success ... ok ([WILDCARD])

failures:

./test/finally_timeout.ts > error
Error: fail
error => ./test/finally_timeout.ts:[WILDCARD]
error: Error: fail
throw new Error("fail");
^
at [WILDCARD]/test/finally_timeout.ts:4:11

failures:

./test/finally_timeout.ts
error
error => ./test/finally_timeout.ts:[WILDCARD]

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD])

Expand Down
7 changes: 3 additions & 4 deletions cli/tests/testdata/test/no_prompt_by_default.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ no prompt ... FAILED ([WILDCARD]ms)

failures:

./test/no_prompt_by_default.ts > no prompt
PermissionDenied: Requires read access to "./some_file.txt", run again with the --allow-read flag
no prompt => ./test/no_prompt_by_default.ts:[WILDCARD]
error: PermissionDenied: Requires read access to "./some_file.txt", run again with the --allow-read flag
[WILDCARD]

failures:

./test/no_prompt_by_default.ts
no prompt
no prompt => ./test/no_prompt_by_default.ts:[WILDCARD]

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]ms)

Expand Down
7 changes: 3 additions & 4 deletions cli/tests/testdata/test/no_prompt_with_denied_perms.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ no prompt ... FAILED ([WILDCARD]ms)

failures:

./test/no_prompt_with_denied_perms.ts > no prompt
PermissionDenied: Requires read access to "./some_file.txt", run again with the --allow-read flag
no prompt => ./test/no_prompt_with_denied_perms.ts:[WILDCARD]
error: PermissionDenied: Requires read access to "./some_file.txt", run again with the --allow-read flag
[WILDCARD]

failures:

./test/no_prompt_with_denied_perms.ts
no prompt
no prompt => ./test/no_prompt_with_denied_perms.ts:[WILDCARD]

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ([WILDCARD]ms)

Expand Down
Loading