Browse Source

test: remove template literal

PR-URL: https://github.com/nodejs/node/pull/15953
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
v9.x-staging
Emily Ford 8 years ago
committed by Ruben Bridgewater
parent
commit
e6e58fde8b
No known key found for this signature in database GPG Key ID: F07496B3EB3C1762
  1. 32
      test/addons-napi/test_error/test.js

32
test/addons-napi/test_error/test.js

@ -15,46 +15,34 @@ class MyError extends Error { }
const myError = new MyError('Some MyError'); const myError = new MyError('Some MyError');
// Test that native error object is correctly classed // Test that native error object is correctly classed
assert.strictEqual(test_error.checkError(theError), true, assert.strictEqual(test_error.checkError(theError), true);
'Error object correctly classed by napi_is_error');
// Test that native type error object is correctly classed // Test that native type error object is correctly classed
assert.strictEqual(test_error.checkError(theTypeError), true, assert.strictEqual(test_error.checkError(theTypeError), true);
'Type error object correctly classed by napi_is_error');
// Test that native syntax error object is correctly classed // Test that native syntax error object is correctly classed
assert.strictEqual(test_error.checkError(theSyntaxError), true, assert.strictEqual(test_error.checkError(theSyntaxError), true);
'Syntax error object correctly classed by napi_is_error');
// Test that native range error object is correctly classed // Test that native range error object is correctly classed
assert.strictEqual(test_error.checkError(theRangeError), true, assert.strictEqual(test_error.checkError(theRangeError), true);
'Range error object correctly classed by napi_is_error');
// Test that native reference error object is correctly classed // Test that native reference error object is correctly classed
assert.strictEqual(test_error.checkError(theReferenceError), true, assert.strictEqual(test_error.checkError(theReferenceError), true);
'Reference error object correctly classed by' +
' napi_is_error');
// Test that native URI error object is correctly classed // Test that native URI error object is correctly classed
assert.strictEqual(test_error.checkError(theURIError), true, assert.strictEqual(test_error.checkError(theURIError), true);
'URI error object correctly classed by napi_is_error');
// Test that native eval error object is correctly classed // Test that native eval error object is correctly classed
assert.strictEqual(test_error.checkError(theEvalError), true, assert.strictEqual(test_error.checkError(theEvalError), true);
'Eval error object correctly classed by napi_is_error');
// Test that class derived from native error is correctly classed // Test that class derived from native error is correctly classed
assert.strictEqual(test_error.checkError(myError), true, assert.strictEqual(test_error.checkError(myError), true);
'Class derived from native error correctly classed by' +
' napi_is_error');
// Test that non-error object is correctly classed // Test that non-error object is correctly classed
assert.strictEqual(test_error.checkError({}), false, assert.strictEqual(test_error.checkError({}), false);
'Non-error object correctly classed by napi_is_error');
// Test that non-error primitive is correctly classed // Test that non-error primitive is correctly classed
assert.strictEqual(test_error.checkError('non-object'), false, assert.strictEqual(test_error.checkError('non-object'), false);
'Non-error primitive correctly classed by napi_is_error');
assert.throws(() => { assert.throws(() => {
test_error.throwExistingError(); test_error.throwExistingError();

Loading…
Cancel
Save