-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chapter: Assertion API #3
Comments
assert.equal function tests equality with == instead of ===(as mentioned in book). Reference: https://nodejs.org/api/assert.html#assert_assert_notequal_actual_expected_message |
Same for assert.notEqual function tests equality with != instead of !==(as mentioned in book). Reference: https://nodejs.org/api/assert.html#assert_assert_notequal_actual_expected_message |
Visual Studio Code marks assert.equal() as deprecated, and styles the This appears to be due to an older version of the @types/node module being used (12.6.2). Installing a newer version, like 14.14.21, seems to fix the issue. I did Note: The Visual Studio Code August 2020 update added the styling of deprecated methods, which makes the @types/node bug more obvious. |
Note that the book and code are using the strict version. They do |
@mday64 Thanks for reporting this! I switched to import * as assert from 'assert/strict'; and don’t see the issue in VS Code anymore. |
Thanks! Originally the import statement was: import { strict as assert } from 'assert'; To make things clearer, it is now: import * as assert from 'assert/strict'; In the book: https://exploringjs.com/impatient-js/ch_assertion-api.html#assertions-in-software-development |
No description provided.
The text was updated successfully, but these errors were encountered: