Skip to content

Commit

Permalink
fix(test): add slice method to filename to make them portable (#16482)
Browse files Browse the repository at this point in the history
In order for test cases to pass regardless of each individual's environment,
this commit adds calls to `slice` method when printing the filenames so
we can avoid getting `console.log` to truncate them.

Fixes #16305
  • Loading branch information
shogohida authored Oct 31, 2022
1 parent 05eb4d1 commit 80ed54a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/queue_microtask_error_handled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ addEventListener("error", (event) => {
console.log({
cancelable: event.cancelable,
message: event.message,
filename: event.filename,
filename: event.filename?.slice?.(-100),
lineno: event.lineno,
colno: event.colno,
error: event.error,
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/report_error_handled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ addEventListener("error", (event) => {
console.log({
cancelable: event.cancelable,
message: event.message,
filename: event.filename,
filename: event.filename?.slice?.(-100),
lineno: event.lineno,
colno: event.colno,
error: event.error,
Expand Down

0 comments on commit 80ed54a

Please sign in to comment.