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 there is a character used in a format specifier such as d or s immediately after %% (e.g. %%d), % replaced from %% is considered as a prefix of format specifier.
To Reproduce
Steps to reproduce the behavior:
index.test.js
describe("test name should to be %",()=>{test.each([[1,2,3]])("%%",(a,b,expected)=>{expect(a+b).toBe(expected);});});describe("test name should to be %d",()=>{test.each([[1,2,3]])("%%d",(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 % ✓ % 1 (1 ms) test name should to be %d ✓ 2 1Test Suites: 1 passed, 1 totalTests: 2 passed, 2 totalSnapshots: 0 totalTime: 0.244 s, estimated 1 sRan all test suites.
Expected behavior
$ npx jest PASS ./index.test.js test name should to be % ✓ % (1 ms) test name should to be %d ✓ %dTest Suites: 1 passed, 1 totalTests: 2 passed, 2 totalSnapshots: 0 totalTime: 0.244 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
%%
consume an argument.d
ors
immediately after%%
(e.g.%%d
),%
replaced from%%
is considered as a prefix of format specifier.To Reproduce
Steps to reproduce the behavior:
index.test.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: