Stylelint: Unhandled promise rejections are deprecated

Created on 4 Dec 2016  Â·  3Comments  Â·  Source: stylelint/stylelint

Via https://travis-ci.org/stylelint/stylelint/jobs/181025542

...
 PASS  lib/utils/__tests__/report.test.js
(node:2404) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 27): Error: expect(received).toBeTruthy()
Expected value to be truthy, instead received
  false
(node:2404) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
 PASS  lib/utils/__tests__/isStandardSyntaxRule.test.js
...
needs investigation

Most helpful comment

Found the cause for this. There was some buggy promise handling in a few Jest util tests. Will fix.

Worth noting — I didn't know about this until exploring this issue — you can add a listener for unhandled promise rejections and get a better stack trace:

process.on("unhandledRejection", (reason) => {
  console.log(reason)
})

All 3 comments

Hm, when we get these tests actually running on Travis, the same error occurs on Node 6 — not seeing on 4. Aha, and I can reproduce that locally. Will investigate.

Found the cause for this. There was some buggy promise handling in a few Jest util tests. Will fix.

Worth noting — I didn't know about this until exploring this issue — you can add a listener for unhandled promise rejections and get a better stack trace:

process.on("unhandledRejection", (reason) => {
  console.log(reason)
})

Woot 🎉

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonathantneal picture jonathantneal  Â·  3Comments

jeddy3 picture jeddy3  Â·  3Comments

sindresorhus picture sindresorhus  Â·  3Comments

Havunen picture Havunen  Â·  3Comments

jitendravyas picture jitendravyas  Â·  3Comments