Skip to content

Commit 2e2e802

Browse files
Trottevanlucas
authored andcommitted
test: make test-buffer-slow engine agnostic
Do not check the error message if it is generated by the JavaScript engine (V8, ChakraCore, etc.). Do confirm that it is a `RangeError`. PR-URL: #16272 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 7a53783 commit 2e2e802

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/parallel/test-buffer-slow.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ try {
3434
assert.strictEqual(
3535
SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength);
3636
} catch (e) {
37-
assert.strictEqual(e.message, 'Array buffer allocation failed');
37+
// Don't match on message as it is from the JavaScript engine. V8 and
38+
// ChakraCore provide different messages.
39+
assert.strictEqual(e.name, 'RangeError');
3840
}
3941

4042
// should work with number-coercible values

0 commit comments

Comments
 (0)