Skip to content

Commit 2e100c8

Browse files
TrottMylesBorins
authored andcommitted
test: remove literals that obscure assert messages
Remove string literals as messages to `assert.strictEqual()`. They can be misleading here (where perhaps the reason an assertino failed isn't that the deleter wasn't called but rather was called too many times. Backport-PR-URL: #19265 PR-URL: #17642 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 077e187 commit 2e100c8

File tree

1 file changed

+3
-4
lines changed
  • test/addons-napi/test_buffer

1 file changed

+3
-4
lines changed

test/addons-napi/test_buffer/test.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@ assert.strictEqual(binding.newBuffer().toString(), binding.theText);
99
assert.strictEqual(binding.newExternalBuffer().toString(), binding.theText);
1010
console.log('gc1');
1111
global.gc();
12-
assert.strictEqual(binding.getDeleterCallCount(), 1, 'deleter was not called');
12+
assert.strictEqual(binding.getDeleterCallCount(), 1);
1313
assert.strictEqual(binding.copyBuffer().toString(), binding.theText);
1414

1515
let buffer = binding.staticBuffer();
16-
assert.strictEqual(binding.bufferHasInstance(buffer), true,
17-
'buffer type checking fails');
16+
assert.strictEqual(binding.bufferHasInstance(buffer), true);
1817
assert.strictEqual(binding.bufferInfo(buffer), true);
1918
buffer = null;
2019
global.gc();
2120
console.log('gc2');
22-
assert.strictEqual(binding.getDeleterCallCount(), 2, 'deleter was not called');
21+
assert.strictEqual(binding.getDeleterCallCount(), 2);

0 commit comments

Comments
 (0)