Skip to content

Commit c86fb64

Browse files
authored
Updated to use assert/strict everywhere (#17047)
refs: https://github.com/TryGhost/Toolbox/issues/595 We're rolling out new rules around the node assert library, the first of which is enforcing the use of assert/strict. This means we don't need to use the strict version of methods, as the standard version will work that way by default. This caught some gotchas in our existing usage of assert where the lack of strict mode had unexpected results: - Url matching needs to be done on `url.href` see TryGhost/Ghost@aa58b35 - Null and undefined are not the same thing, there were a few cases of this being confused - Particularly questionable changes in [PostExporter tests](TryGhost/Ghost@c1a4687) tracked [here](TryGhost/Product#3505). - A typo see TryGhost/Ghost@eaac9c2 Moving forward, using assert strict should help us to catch unexpected behaviour, particularly around nulls and undefineds during implementation.
1 parent 2d477b0 commit c86fb64

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/html-to-plaintext/test/html-to-plaintext.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const assert = require('assert');
1+
const assert = require('assert/strict');
22
const htmlToPlaintext = require('../');
33

44
describe('Html to Plaintext', function () {

packages/members-csv/test/parse.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const path = require('path');
2-
const assert = require('assert');
2+
const assert = require('assert/strict');
33
const {parse} = require('../index');
44
const csvPath = path.join(__dirname, '/fixtures/');
55

packages/members-csv/test/unparse.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const assert = require('assert');
1+
const assert = require('assert/strict');
22
const {unparse} = require('../index');
33

44
describe('unparse', function () {

0 commit comments

Comments
 (0)