You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pnpm jest inline-snapshot.test.js --updateSnapshot (though I had to run pnpm jest inline-snapshot.test.js --updateSnapshot --prettierPath '' perhaps due to quirks in my path having prettier on it)
Observe the diff in inline-snapshot.test.js
Expected behavior
I see
test("a failing inline snapshot will append, not overwrite as desired", () => {
- expect("expected string").toMatchInlineSnapshot('"incorrect string"');+ expect("expected string").toMatchInlineSnapshot(`"expected string"`);
});
Actual behavior
I see
test("a failing inline snapshot will append, not overwrite as desired", () => {
- expect("expected string").toMatchInlineSnapshot('"incorrect string"');+ expect("expected string").toMatchInlineSnapshot('"incorrect string"', `"expected string"`);
});
Additional context
Our single-line template literals are being rewritten with single quotes due to our usage of the quotes eslint rule, thus we run into this issue.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Version
29.6.4
Steps to reproduce
pnpm install
pnpm jest inline-snapshot.test.js --updateSnapshot
(though I had to runpnpm jest inline-snapshot.test.js --updateSnapshot --prettierPath ''
perhaps due to quirks in my path havingprettier
on it)inline-snapshot.test.js
Expected behavior
I see
Actual behavior
I see
Additional context
Our single-line template literals are being rewritten with single quotes due to our usage of the
quotes
eslint rule, thus we run into this issue.I believe that I've traced the issue to
jest/packages/jest-snapshot/src/InlineSnapshots.ts
Line 277 in f2c78d0
fixes the issue. I'll be pushing up a PR soon with that proposed fix.
Environment
The text was updated successfully, but these errors were encountered: