Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Jest: Error shows the wrong line number #138

Open
zgorizzo69 opened this issue Sep 4, 2020 · 1 comment
Open

Jest: Error shows the wrong line number #138

zgorizzo69 opened this issue Sep 4, 2020 · 1 comment

Comments

@zgorizzo69
Copy link

configuration

$ npx truffle version                          
Truffle v5.1.43 (core: 5.1.43)
Solidity - ^0.7.0 (solc-js)
Node v12.16.3
Web3.js v1.2.1

Behaviour

The error output always shows a wrong line number when Jest is used instead of truffle mocha/chai
if you run the test it will display an error at Object.<anonymous> (tests/anchorV0.spec.js:17:19) while the actual error is located at line 23 where the expect statement is.
Moreover if you add extra blank lines in the test file the error line will be different ...
image

Expected behaviour

the error output should display the actual line where the error is raised in our example it would be line 23

How to reproduce

git clone the repo https://github.com/zgorizzo69/truffle-OZ-Jest-Fail and run yarn && yarn test

@frangio
Copy link
Contributor

frangio commented Sep 8, 2020

Thank you for reporting @zgorizzo69.

I'd be very surprised if this error was caused by Test Environment. Can you share what makes you think that it could be this library?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants