diff --git a/test/parallel/test-buffer-compare.js b/test/parallel/test-buffer-compare.js index c0db39a6e3c8bc..6182d0967d4900 100644 --- a/test/parallel/test-buffer-compare.js +++ b/test/parallel/test-buffer-compare.js @@ -23,8 +23,11 @@ assert.strictEqual(Buffer.compare(Buffer.alloc(0), Buffer.alloc(0)), 0); assert.strictEqual(Buffer.compare(Buffer.alloc(0), Buffer.alloc(1)), -1); assert.strictEqual(Buffer.compare(Buffer.alloc(1), Buffer.alloc(0)), 1); -assert.throws(() => Buffer.compare(Buffer.alloc(1), 'abc')); +assert.throws(() => Buffer.compare(Buffer.alloc(1), 'abc'), + /^TypeError: Arguments must be Buffers$/); -assert.throws(() => Buffer.compare('abc', Buffer.alloc(1))); +assert.throws(() => Buffer.compare('abc', Buffer.alloc(1)), + /^TypeError: Arguments must be Buffers$/); -assert.throws(() => Buffer.alloc(1).compare('abc')); +assert.throws(() => Buffer.alloc(1).compare('abc'), + /^TypeError: Argument must be a Buffer$/);