question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
BridgeARcommented, May 20, 2019

I just landed a PR in Node.js that should be included in the next version. It makes sure that %s uses toString functions on objects in case the function is defined by the user.

0reactions
github-actions[bot]commented, May 11, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found