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

Handle erroneous location (at) information gracefully #2

Open
aral opened this issue Jun 2, 2022 · 0 comments
Open

Handle erroneous location (at) information gracefully #2

aral opened this issue Jun 2, 2022 · 0 comments

Comments

@aral
Copy link
Contributor

aral commented Jun 2, 2022

Sometimes, it seems that the file location (error.at) information is not correctly populated.

e.g., I’m getting the following when tests fail because an object doesn’t exist in my current app:

{ file: '', line: undefined, character: '[as' }

Detect this and handle it gracefully.

Suggested implementation

When this is detected, look in the stack trace (if it exists) for the file:/// line and use that. e.g.,

  TypeError: utils.calculateBasePath is not a function
  at file:///var/home/aral/Projects/nodekit/tests/utils.js:120:26
  at Test.<anonymous> (/var/home/aral/Projects/nodekit/node_modules/tape-promise/index.compiled.js:86:19)
  at Test.bound [as _cb] (/var/home/aral/Projects/nodekit/node_modules/tape/lib/test.js:99:32)
  at Test.run (/var/home/aral/Projects/nodekit/node_modules/tape/lib/test.js:117:31)
  at Test.bound [as run] (/var/home/aral/Projects/nodekit/node_modules/tape/lib/test.js:99:32)
  at Immediate.next [as _onImmediate] (/var/home/aral/Projects/nodekit/node_modules/tape/lib/results.js:88:19)
  at process.processImmediate (node:internal/timers:471:21)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant