Skip to content

Commit e0c8aaf

Browse files
committed
test: fix test-buffer-slow
Fix incorrect use of string instead of RegExp in `throws` assertions. PR-URL: #9809 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Prince John Wesley <princejohnwesley@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent e72dfce commit e0c8aaf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/parallel/test-buffer-slow.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ assert.strictEqual(SlowBuffer('string').length, 0);
4646
// should throw with invalid length
4747
assert.throws(function() {
4848
new SlowBuffer(Infinity);
49-
}, 'invalid Buffer length');
49+
}, /^RangeError: Invalid typed array length$/);
5050
assert.throws(function() {
5151
new SlowBuffer(-1);
52-
}, 'invalid Buffer length');
52+
}, /^RangeError: Invalid typed array length$/);
5353
assert.throws(function() {
5454
new SlowBuffer(buffer.kMaxLength + 1);
55-
}, 'invalid Buffer length');
55+
}, /^RangeError: (Invalid typed array length|Array buffer allocation failed)$/);

0 commit comments

Comments
 (0)