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
You should see what I see, an internal error in Jest.
Expected behavior
I expect one of the following to occur:
Jest gives an error saying that it is invalid to specify --outputFile multiple times
Jest runs normally and writes JSON output to either output1.json or output2.json
Jest runs normally and writes JSON output to both output1.json and output2.json
Actual behavior
The tests run successfully, but then the error with the following stack trace occurs, before any output files are written:
TypeError: The "path" argument must be of type string. Received an instance of Array
at new NodeError (node:internal/errors:371:5)
at validateString (node:internal/validators:120:11)
at Object.resolve (node:path:1098:7)
at processResults (/home/victor/git/jest-crash/node_modules/@jest/core/build/runJest.js:184:31)
at runJest (/home/victor/git/jest-crash/node_modules/@jest/core/build/runJest.js:358:9)
at _run10000 (/home/victor/git/jest-crash/node_modules/@jest/core/build/cli/index.js:326:7)
at runCLI (/home/victor/git/jest-crash/node_modules/@jest/core/build/cli/index.js:191:3)
at Object.run (/home/victor/git/jest-crash/node_modules/jest-cli/build/run.js:124:37)
I think the root of this issue is the call to yargs in run.ts (link). The object that yargs returns does not match the Config.Argv type. If --outputFile is passed on the command line multiple times, the outputFile property is an array, which should normally not be assignable to the declared type of outputFile, which is string. This may happen with other options/properties too.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
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.3.1 and also main (6fc1860)
Steps to reproduce
npm install
npm test
You should see what I see, an internal error in Jest.
Expected behavior
I expect one of the following to occur:
--outputFile
multiple timesActual behavior
The tests run successfully, but then the error with the following stack trace occurs, before any output files are written:
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: