-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esm changes error stacks in a way that AVA is not expecting. This adds a few workarounds, though admittedly all the packages we're using and workarounds we're applying are making a bit of a mess. See https://github.com/standard-things/esm/wiki/improved-errors for esm's behavior.
- Loading branch information
1 parent
a130a9e
commit 37390e6
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,7 +101,9 @@ function trySerializeError(err, shouldBeautifyStack) { | |
} | ||
retval.summary = retval.summary.trim(); | ||
} else { | ||
retval.summary = lines[0]; | ||
// Skip the source line header inserted by `esm`: | ||
// <https://github.com/standard-things/esm/wiki/improved-errors> | ||
retval.summary = lines.find(line => !/:\d+$/.test(line)); | ||
This comment has been minimized.
Sorry, something went wrong.
jdalton
Contributor
|
||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 comment
on commit 37390e6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's anything else you run into please don't hesitate to ping me on it (even for things like this).
☝️ Node currently uses
file://
URL's for their experimental ESM usage too (is reported in their stacks).