Giter VIP home page Giter VIP logo

Comments (6)

JSanchezIO avatar JSanchezIO commented on June 12, 2024

Was this related to https://swc.rs/blog/2021/04/20/swc-1.2.54#sourcemaps-1581?

from swc-node.

Brooooooklyn avatar Brooooooklyn commented on June 12, 2024

@JSanchezIO I can not reproduce in #367, could you please provide your jest config?

from swc-node.

JSanchezIO avatar JSanchezIO commented on June 12, 2024

It's working locally for me now.

from swc-node.

JSanchezIO avatar JSanchezIO commented on June 12, 2024

Just for awareness, this was the jest config:

module.exports = {
  setupFilesAfterEnv: ['./jest.setup.ts'],
  testEnvironment: 'jsdom',
  testPathIgnorePatterns: ['<rootDir>/e2e/', '/node_modules/', '/.stryker-tmp/'],
  transform: {
    '^.+\\.(t|j)sx?$': ['@swc-node/jest'],
  },
  watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
};

from swc-node.

vvo avatar vvo commented on June 12, 2024

Hey there, using latest Jest and latest swc-node, I am still experiencing this issue.

tsconfig.json

{
  "extends": "@tsconfig/node12/tsconfig.json",
  "include": ["src", "next"],
  "exclude": ["node_modules", "./**/dist"],
  "compilerOptions": {
    "paths": {
      "iron-session": ["./src/index.ts"],
      "iron-session/next": ["./next/index.ts"]
    },
    "sourceMap": true
  }
}

package.json

{
  "jest": {
    "transform": {
      "^.+\\.(t|j)sx?$": [
        "@swc-node/jest"
      ]
    }
  }
}

index.test.ts

test("it throws when calling save() and headers were already sent", async () => {
  const session = await getIronSession(
    {
      headers: {},
    } as IncomingMessage,
    {
      headersSent: true,
    } as unknown as ServerResponse,
    { password, cookieName },
  );

  await expect(session.save()).rejects.toThrowErrorMatchingInlineSnapshot(``);
});
> npx jest -u
 FAIL  src/index.test.ts
  ● Test suite failed to run

    Jest: Couldn't locate all inline snapshots.

      at traverseAst (node_modules/jest-snapshot/build/InlineSnapshots.js:377:11)
      at TestScheduler.scheduleTests (node_modules/@jest/core/build/TestScheduler.js:333:13)

> npm view jest version
27.3.1

from swc-node.

Gervwyk avatar Gervwyk commented on June 12, 2024

Also experiencing this issue on "jest": "27.3.1", and "@swc/jest": "0.2.5",

from swc-node.

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.