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

Jest: Couldn't locate all inline snapshots when empty to match inline snapshot #32

Open
semoal opened this issue May 6, 2021 · 1 comment

Comments

@semoal
Copy link

semoal commented May 6, 2021

Hello folks!

I've tried to use this plugin with inline snapshoting and I've get this error, probably it's related to the compiled code by esbuild, Jest can't find where it's the code located, but I'm not sure how to debug it.

Do you have any clues or guidance, I can help fixing the bug =)

I've modified one of your examples

it("should render", () => {
  render(<App />, element);
-  expect(element.innerHTML).toMatchInlineSnapshot(`"<div>hello world!</div>"`)
+  expect(element.innerHTML).toMatchInlineSnapshot()
});
 FAIL  tests/react-ts.spec.tsx
  ● Test suite failed to run

    Jest: Couldn't locate all inline snapshots.

      at Object.parse (node_modules/jest-snapshot/build/InlineSnapshots.js:267:11)

And the test's fails, I've tried to replace esbuild-jest by the standard babel implementation and works correctly!

@peterp
Copy link

peterp commented Jul 22, 2021

You have to generate sourcemaps, in my opinion this should be the default: https://github.com/aelbore/esbuild-jest#setting-up-jest-config-file-with-transformoptions

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

2 participants