From 021ccb4011a6c507dfde2f8d8f555ab4188a5782 Mon Sep 17 00:00:00 2001 From: John Byrne Date: Mon, 6 Nov 2017 15:03:54 +0000 Subject: [PATCH] test: use default assertion messages The string literal messages in addons-napi/test_buffer/test.js are less helpful than the default messages, so use the default messages. PR-URL: https://github.com/nodejs/node/pull/16808 Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Rich Trott --- test/addons-napi/test_buffer/test.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/addons-napi/test_buffer/test.js b/test/addons-napi/test_buffer/test.js index 6fb80b02053f9f..713966775df18b 100644 --- a/test/addons-napi/test_buffer/test.js +++ b/test/addons-napi/test_buffer/test.js @@ -5,20 +5,17 @@ const common = require('../../common'); const binding = require(`./build/${common.buildType}/test_buffer`); const assert = require('assert'); -assert.strictEqual(binding.newBuffer().toString(), binding.theText, - 'buffer returned by newBuffer() has wrong contents'); -assert.strictEqual(binding.newExternalBuffer().toString(), binding.theText, - 'buffer returned by newExternalBuffer() has wrong contents'); +assert.strictEqual(binding.newBuffer().toString(), binding.theText); +assert.strictEqual(binding.newExternalBuffer().toString(), binding.theText); console.log('gc1'); global.gc(); assert.strictEqual(binding.getDeleterCallCount(), 1, 'deleter was not called'); -assert.strictEqual(binding.copyBuffer().toString(), binding.theText, - 'buffer returned by copyBuffer() has wrong contents'); +assert.strictEqual(binding.copyBuffer().toString(), binding.theText); let buffer = binding.staticBuffer(); assert.strictEqual(binding.bufferHasInstance(buffer), true, 'buffer type checking fails'); -assert.strictEqual(binding.bufferInfo(buffer), true, 'buffer data is accurate'); +assert.strictEqual(binding.bufferInfo(buffer), true); buffer = null; global.gc(); console.log('gc2');