Skip to content
Browse files

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.

PR-URL: #17642
Reviewed-By: Anna Henningsen <>
Reviewed-By: Ruben Bridgewater <>
Reviewed-By: Colin Ihrig <>
Reviewed-By: Luigi Pinca <>
Reviewed-By: Jon Moss <>
Reviewed-By: James M Snell <>
Reviewed-By: Anatoli Papirovski <>
Reviewed-By: Michael Dawson <>
  • Loading branch information
Trott committed Dec 14, 2017
1 parent f86427e commit 246aeaca1ed47e245ee4c92084b59f5ddb31163c
Showing with 3 additions and 4 deletions.
  1. +3 −4 test/addons-napi/test_buffer/test.js
@@ -9,14 +9,13 @@ assert.strictEqual(binding.newBuffer().toString(), binding.theText);
assert.strictEqual(binding.newExternalBuffer().toString(), binding.theText);
assert.strictEqual(binding.getDeleterCallCount(), 1, 'deleter was not called');
assert.strictEqual(binding.getDeleterCallCount(), 1);
assert.strictEqual(binding.copyBuffer().toString(), binding.theText);

let buffer = binding.staticBuffer();
assert.strictEqual(binding.bufferHasInstance(buffer), true,
'buffer type checking fails');
assert.strictEqual(binding.bufferHasInstance(buffer), true);
assert.strictEqual(binding.bufferInfo(buffer), true);
buffer = null;
assert.strictEqual(binding.getDeleterCallCount(), 2, 'deleter was not called');
assert.strictEqual(binding.getDeleterCallCount(), 2);

0 comments on commit 246aeac

Please sign in to comment.
You can’t perform that action at this time.