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
I found it confusing that values not used in the test table were appended to my template:
In my case, I needed some extra logic to determine my title, so I did this:
consttable=testFiles.map(testFile=>{constshouldPass=SHOULD_NOT_PASS_IN_JEST.has(testFile);constexpectation=`${testFile}${shouldPass ? 'errors' : 'passes'}`;consttestName=`${expectation} when not in erroOnDeprecated mode`;return[testName,shouldPass,testFile];});test.each(table)('%s',(testName,shouldPass,testFile)=>{constresult=runJest('error-on-deprecated',[testFile]);expect(result.status).toBe(shouldPass ? 1 : 0);});
And ended up with titles like this:
✓ fail.test.js errors when not in erroOnDeprecated mode true fail.test.js (541ms)
✓ jasmine.addMatchers.test.js passes when not in erroOnDeprecated mode false jasmine.addMatchers.test.js (526ms)
✓ jasmine.any.test.js passes when not in erroOnDeprecated mode false jasmine.any.test.js (527ms)
✓ jasmine.anything.test.js passes when not in erroOnDeprecated mode false jasmine.anything.test.js (519ms)
✓ jasmine.arrayContaining.test.js passes when not in erroOnDeprecated mode false jasmine.arrayContaining.test.js (521ms)
✓ jasmine.createSpy.test.js passes when not in erroOnDeprecated mode false jasmine.createSpy.test.js (553ms)
✓ jasmine.objectContaining.test.js passes when not in erroOnDeprecated mode false jasmine.objectContaining.test.js (536ms)
✓ jasmine.stringMatching.test.js passes when not in erroOnDeprecated mode false jasmine.stringMatching.test.js (506ms)
✓ pending.test.js passes when not in erroOnDeprecated mode false pending.test.js (509ms)
✓ spyOn.test.js passes when not in erroOnDeprecated mode false spyOn.test.js (551ms)
✓ spyOnProperty.test.js errors when not in erroOnDeprecated mode true spyOnProperty.test.js (537ms)
✓ DEFAULT_TIMEOUT_INTERVAL.test.js passes when not in erroOnDeprecated mode false DEFAULT_TIMEOUT_INTERVAL.test.js (531ms)
It was surprising to me that the unused arguments were appended. Could get extra confusing if the extra values were not easily serializable.
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.
I found it confusing that values not used in the test table were appended to my template:
In my case, I needed some extra logic to determine my title, so I did this:
And ended up with titles like this:
It was surprising to me that the unused arguments were appended. Could get extra confusing if the extra values were not easily serializable.
@mattphillips
The text was updated successfully, but these errors were encountered: