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
When the value of array contains multiple %, wrong interpolation may occur.
To Reproduce
index.text.js
describe("test name should to be `%d %d`",()=>{test.each([["%d %d",1,2,3]])("%s",(_,a,b,expected)=>{expect(a+b).toBe(expected);});});describe("test name should to be `%%d`",()=>{test.each([["%%d",1,2,3]])("%s",(_,a,b,expected)=>{expect(a+b).toBe(expected);});});
Run npx jest, then you can see the following:
$ npx jest PASS ./index.test.js test name should to be `%d %d` ✓ %d 1 (2 ms) test name should to be `%%d` ✓ %1Test Suites: 1 passed, 1 totalTests: 2 passed, 2 totalSnapshots: 0 totalTime: 0.324 s, estimated 1 sRan all test suites.
Expected behavior
$ npx jest PASS ./index.test.js test name should to be `%d %d` ✓ %d %d (2 ms) test name should to be `%%d` ✓ %%dTest Suites: 1 passed, 1 totalTests: 2 passed, 2 totalSnapshots: 0 totalTime: 0.324 s, estimated 1 sRan all test suites.
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.
🐛 Bug Report
When the value of array contains multiple
%
, wrong interpolation may occur.To Reproduce
index.text.js
Run
npx jest
, then you can see the following:Expected behavior
Link to repl or repo (highly encouraged)
envinfo
The text was updated successfully, but these errors were encountered: