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

Usage together with TestCafe loses stacktrace incl. line numbers #215

Open
pschmolke opened this issue May 31, 2022 · 0 comments
Open

Usage together with TestCafe loses stacktrace incl. line numbers #215

pschmolke opened this issue May 31, 2022 · 0 comments

Comments

@pschmolke
Copy link

pschmolke commented May 31, 2022

The testing framework TestCafe by DevExpress has a standard reporter called spec (issue exists for other reporters as well) which prints additional output to the stdout, like the stacktrace with the failing line number, previous lines and preceding lines.
When using tsconfig-paths/register to enable non-relative imports, the stacktrace is completly lost. Only the failing assertion is now shown, that in many cases (especially nested ones) is not very helpful.

Is there maybe some sourceMap information lost on resolving the import statements?

I register the import grammatically on the first line of the file with import tsconfig-paths/register

Output with tsconfig-paths:

 Running tests in:
 - Chrome 102.0.5005.61 / Linux 0.0

 test fixture
start test
bar
 ✖ debug

   1) AssertionError: expected true to deeply equal false
      
      + expected - actual
      
      -true
      +false
      

      Browser: Chrome 102.0.5005.61 / Linux 0.0



 1/1 failed (0s)

Output with relative imports:

 Running tests in:
 - Chrome 102.0.5005.61 / Linux 0.0

 test fixture
start test
 ✖ debug

   1) AssertionError: expected true to deeply equal false
      
      + expected - actual
      
      -true
      +false
      

      Browser: Chrome 102.0.5005.61 / Linux 0.0

          4 |fixture `test fixture`;
          5 |
          6 |test( 'debug', async ( t: TestController ) => {
          7 |   console.log( 'start test' );
          8 |
       >  9 |   await t.expect( true ).eql( false );
         10 |
         11 |   console.log( 'end test' );
         12 |} )

         at <anonymous> (/somepath-to-workspace/pschmolke/git/playground/tests/index.ts:9:27)
         at <anonymous> (/somepath-to-workspace/pschmolke/git/playground/tests/index.ts:8:71)
         at __awaiter (/somepath-to-workspace/pschmolke/git/playground/tests/index.ts:4:12)
         at <anonymous> (/somepath-to-workspace/pschmolke/git/playground/tests/index.ts:6:46)



 1/1 failed (0s)
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