Skip to content

Commit f4bf701

Browse files
not-an-aardvarkkaicataldo
authored andcommitted
Chore: avoid loose equality assertions (#9415)
* Chore: avoid loose equality assertions This updates the `no-restricted-syntax` configuration to disallow `assert.equal` and `assert.notEqual` in favor of `assert.strictEqual` and `assert.notStrictEqual`. It also fixes a few places where the tests were relying on a loose equality check (e.g. comparing a single-element array to a string). * Use assert.deepStrictEqual instead of assert.deepEqual * Revert accidental fixture changes
1 parent 9c16c01 commit f4bf701

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe("formatter:table", () => {
3939

4040
const result = formatter(code);
4141

42-
assert.equal(result, expectedOutput);
42+
assert.strictEqual(result, expectedOutput);
4343
});
4444
});
4545

@@ -80,7 +80,7 @@ describe("formatter:table", () => {
8080

8181
const result = formatter(code);
8282

83-
assert.equal(result, expectedOutput);
83+
assert.strictEqual(result, expectedOutput);
8484
});
8585

8686
it("should return a string in the correct format for warnings", () => {
@@ -119,7 +119,7 @@ describe("formatter:table", () => {
119119

120120
const result = formatter(code);
121121

122-
assert.equal(result, expectedOutput);
122+
assert.strictEqual(result, expectedOutput);
123123
});
124124
});
125125

@@ -160,7 +160,7 @@ describe("formatter:table", () => {
160160

161161
const result = formatter(code);
162162

163-
assert.equal(result, expectedOutput);
163+
assert.strictEqual(result, expectedOutput);
164164
});
165165
});
166166

@@ -209,7 +209,7 @@ describe("formatter:table", () => {
209209

210210
const result = formatter(code);
211211

212-
assert.equal(result, expectedOutput);
212+
assert.strictEqual(result, expectedOutput);
213213
});
214214
});
215215

@@ -269,7 +269,7 @@ describe("formatter:table", () => {
269269

270270
const result = formatter(code);
271271

272-
assert.equal(result, expectedOutput);
272+
assert.strictEqual(result, expectedOutput);
273273
});
274274
});
275275

@@ -307,7 +307,7 @@ describe("formatter:table", () => {
307307

308308
const result = formatter(code);
309309

310-
assert.equal(result, expectedOutput);
310+
assert.strictEqual(result, expectedOutput);
311311
});
312312
});
313313
});

0 commit comments

Comments
 (0)