Skip to content

Commit

Permalink
test: make test-buffer-slow engine agnostic
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trott authored and evanlucas committed Nov 13, 2017
1 parent 7a53783 commit 2e2e802
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/parallel/test-buffer-slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ try {
assert.strictEqual(
SlowBuffer(buffer.kMaxLength).length, buffer.kMaxLength);
} catch (e) {
assert.strictEqual(e.message, 'Array buffer allocation failed');
// Don't match on message as it is from the JavaScript engine. V8 and
// ChakraCore provide different messages.
assert.strictEqual(e.name, 'RangeError');
}

// should work with number-coercible values
Expand Down

0 comments on commit 2e2e802

Please sign in to comment.