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.

console.assert not throwing with v22.4.0

See original GitHub issue

According to NodeJS v8.x doc:

a falsy assertion will cause an AssertionError to be thrown

console.assert(false) does not throw with v22.4.0 (was working at least with v22.1.4):

// Does not work anymore
expect(() => console.assert(false, 'message')).toThrow('message');

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
mjesuncommented, Feb 22, 2018

😆 I’m too used to my internal stuff

3reactions
thymikeecommented, Feb 22, 2018

@mjesun Actually the default env is jest-environment-jsdom 😄 https://github.com/facebook/jest/blob/497be7627ef851c947da830d4a8e21046f847a78/packages/jest-config/src/defaults.js#L63 But I agree with the rest. Anybody willing to send a PR with a fix and a test?

Read more comments on GitHub >

github_iconTop Results From Across the Web

console.assert() - Web APIs | MDN
The console.assert() method writes an error message to the console if the assertion is false. If the assertion is true, nothing happens.
Read more >
@tkrotoff/fetch-web-example - CodeSandbox
... [console.assert not throwing with v22.4.0](https:\u002F\u002Fgithub.com\ ... assert;\n\n(window.fetch as any) = () =\u003E {\n throw new ...
Read more >
@jest/console | Yarn - Package Manager
Fixes for global built in objects in jest-environment-node . Create mock objects in the vm context instead of the parent context. .babelrc is...
Read more >
How can we fix 'TypeError: $.console.assert is not a function ...
I am running tests for a component that is build using third party library 'openseadragon' and it shows me error TypeError: $.console.assert ......
Read more >
2022 Changelog | ClickHouse Docs
This feature is under development and the queries are not effective as of ... Fix the case when the s3Cluster function throws NOT_FOUND_COLUMN_IN_BLOCK ......
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