Giter VIP home page Giter VIP logo

Comments (7)

aaronncfca avatar aaronncfca commented on June 17, 2024 6

I'm facing this issue even with sourceMaps:true, even after clearing the cache! Tests run but line numbers a good bit off. I don't want to spam a closed issue, but I'm not sure what else to try. Let me know if any suggestions!

Here's an exerpt of my .swcrc:

{
    "jsc": {
      "target": "es2017",
      "parser": {
        "syntax": "ecmascript",
        "jsx": true, [...]
      },
        "react": {
          "pragma": "React.createElement", [...]
        }
        "hidden": {
          "jest": true
        }
      }
    },
    "sourceMaps": true,
    "module": {
      "type": "commonjs", [...]
    }
  }

from jest.

lmexo avatar lmexo commented on June 17, 2024 5

I faced the same issue, clearing cache and sourceMaps: true did not work. But it worked when using sourceMaps: 'inline'

from jest.

thantos avatar thantos commented on June 17, 2024 4

I'm facing this issue even with sourceMaps:true, even after clearing the cache! Tests run but line numbers a good bit off. I don't want to spam a closed issue, but I'm not sure what else to try. Let me know if any suggestions!

Here's an exerpt of my .swcrc:

{
    "jsc": {
      "target": "es2017",
      "parser": {
        "syntax": "ecmascript",
        "jsx": true, [...]
      },
        "react": {
          "pragma": "React.createElement", [...]
        }
        "hidden": {
          "jest": true
        }
      }
    },
    "sourceMaps": true,
    "module": {
      "type": "commonjs", [...]
    }
  }

Ever solve this?

Seeing the same issue when minify is on. One by one or two lines.

from jest.

Thisen avatar Thisen commented on June 17, 2024 3

Any status on this?

from jest.

joshyboyrules avatar joshyboyrules commented on June 17, 2024

@srmagura - any chance you run into this issue? #47 (comment)

from jest.

stephenh avatar stephenh commented on June 17, 2024

Fwiw I'm also getting in correct line numbers, not in the Jest output, but just in the stack traces themselves.

I've tried .swcrc enabling them, but that didn't fix it; using the @swc-node/jest project, the line numbers "just worked" the first time, so I'm going to use that for now.

from jest.

stephenh avatar stephenh commented on June 17, 2024

Thanks for changing the default!

I tried the latest @swc/jest: 0.2.16 and thought it was still broken, but running jest --clearCache made it work great!

Fwiw that could have been my error before, is that I'd made a .swcrc w/sourceMaps: true in it, but hadn't cleared the Jest cache, so was seeing stale/cached transformed results from Jest.

from jest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.