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
All tests run, but on completion an error is thrown:
Ran all test suites.
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of XMLElement
at Object.writeFileSync (fs.js:1380:5)
at writeFile (.../node_modules/amex-jest-preset/html-report-creator.js:26:6)
I believe this is due to a breaking change in Node.JS 14.x where data is no longer being coerced nodejs/node#31030
but I wonder if, especialy for large test suites, memory could be conserved by streaming instead https://github.com/oozcitak/xmlbuilder-js/wiki#xml-writers
Is there any reason fs.writeFileSync was used? (Does jest require synchronous behavior?)
Activity
PixnBits commentedon May 14, 2020
fixing this is as easy as adding
.toString()tohtmlOutputhttps://github.com/americanexpress/amex-jest-preset/blob/master/html-report-creator.js#L95
but I wonder if, especialy for large test suites, memory could be conserved by streaming instead
https://github.com/oozcitak/xmlbuilder-js/wiki#xml-writers
Is there any reason
fs.writeFileSyncwas used? (Does jest require synchronous behavior?)amex-jest-preset/html-report-creator.js
Lines 24 to 27 in 64d7d93
anescobar1991 commentedon May 15, 2020
Yes https://jestjs.io/docs/en/configuration.html#testresultsprocessor-string must be synchronous unfortunately.
@PixnBits would you mind opening a PR to fix this?
feat(node): update to work with node 14 (#17)
chore(release): 6.1.0 [skip ci]
oneamexbot commentedon May 26, 2020
🎉 This issue has been resolved in version 6.1.0 🎉
The release is available on:
Your semantic-release bot 📦🚀