Strange tests titles on Node.js v12
See original GitHub issue🐛 Bug Report
test.each doesn’t use test case toString for tests titles generation on Node.js v12 and produces titles like this:
{ toString: [Function: toString] }
To Reproduce
Situation can be reproduced via executing such test on Node.js v12.
describe("Should not use toString", () => {
const testCases = [
{
toString: () => "Clear test title"
}
];
test.each(testCases)("%s", testCase => {});
});
Expected behavior
Test title ought to be “Clear test title” as it is on Node.js v8 and v10.
Link to repl or repo (highly encouraged)
Test cases for which strange titles are generated: https://github.com/litichevskiydv/JsUsefulPrimitives/blob/master/tests/manipulation/manipula.test.js
Build log for Node.js v10: https://travis-ci.org/litichevskiydv/JsUsefulPrimitives/jobs/529938904 Build log for Node.js v12: https://travis-ci.org/litichevskiydv/JsUsefulPrimitives/jobs/529938905
Run npx envinfo --preset jest
Paste the results here:
System:
OS: Linux 4.15 Ubuntu 16.04.6 LTS (Xenial Xerus)
CPU: (2) x64 Intel(R) Xeon(R) CPU @ 2.30GHz
Binaries:
Node: 12.2.0 - ~/.nvm/versions/node/v12.2.0/bin/node
Yarn: 1.15.2 - /usr/local/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v12.2.0/bin/npm
npmPackages:
jest: 24.8.0 => 24.8.0
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
node/CHANGELOG_V12.md at main · nodejs/node - GitHub
Incorrect handling of certificate subject and issuer fields (Medium)(CVE-2021-44533). Node.js did not handle multi-value Relative Distinguished Names correctly.
Read more >Node.js v19.3.0 Documentation
Subtests; Skipping tests; describe / it syntax; only tests ... Error names and messages are always compared, even if these are not enumerable...
Read more >Mocha - the fun, simple, flexible JavaScript test framework
simple, flexible, fun. Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun....
Read more >How to measure and improve Node.js performance - Raygun
Here is a sample application we can use to test out the Node.js ... you will need Node.js (v12+) installed, as well as...
Read more >node.js - Unable to get Angular CLI version, though all the ...
13 or v12.0. Please update your Node.js version or visit https://nodejs.org/ for additional ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I just landed a PR in Node.js that should be included in the next version. It makes sure that
%susestoStringfunctions on objects in case the function is defined by the user.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.