hannoeru / jest-esbuild

A Jest esbuild transformer
MIT License
18 stars 7 forks source link

Show files of stack traces #8

Closed brianmhunt closed 1 year ago

brianmhunt commented 1 year ago

Description

Stack traces currently print out like this:

      at Object.StaticTable (js.packages/writing/blocks/<stdin>:1:1)
      at Object.get [as StaticTable] (js.packages/writing/blocks/StaticTable.ts:17:45)
      at Object.<anonymous> (js.packages/writing/blocks/<stdin>:44:3)
      at Object.<anonymous> (js.packages/views/<stdin>:4:40)
      at Object.<anonymous> (js.packages/EntityModel/<stdin>:2:36)

... but each of the <stdin> references are to a file, and it's impossible to know which one is being referenced.

Suggested solution

Show the filename instead of <stdin> e.g.

      at Object.StaticTable (js.packages/writing/blocks/index.ts:1:1)
      ...

Alternative

No response

Additional context

It's not clear whether this is a jest-esbuild issue/responsibility, but I can't find any reference to it elsewhere so I wonder if it's something that can/should/must be solved here.

Validations

orzarchi commented 1 year ago

I've fixed it here: https://github.com/hannoeru/jest-esbuild/pull/9