Skip to content
Permalink
Browse files

test: remove template literal

PR-URL: #15953
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
emilyford authored and MylesBorins committed Oct 6, 2017
1 parent ba9aa46 commit 9059b09a34ab390cb492d1f3fc34abd56344d038
Showing with 10 additions and 22 deletions.
  1. +10 −22 test/addons-napi/test_error/test.js
@@ -15,46 +15,34 @@ class MyError extends Error { }
const myError = new MyError('Some MyError');

// Test that native error object is correctly classed
assert.strictEqual(test_error.checkError(theError), true,
'Error object correctly classed by napi_is_error');
assert.strictEqual(test_error.checkError(theError), true);

// Test that native type error object is correctly classed
assert.strictEqual(test_error.checkError(theTypeError), true,
'Type error object correctly classed by napi_is_error');
assert.strictEqual(test_error.checkError(theTypeError), true);

// Test that native syntax error object is correctly classed
assert.strictEqual(test_error.checkError(theSyntaxError), true,
'Syntax error object correctly classed by napi_is_error');
assert.strictEqual(test_error.checkError(theSyntaxError), true);

// Test that native range error object is correctly classed
assert.strictEqual(test_error.checkError(theRangeError), true,
'Range error object correctly classed by napi_is_error');
assert.strictEqual(test_error.checkError(theRangeError), true);

// Test that native reference error object is correctly classed
assert.strictEqual(test_error.checkError(theReferenceError), true,
'Reference error object correctly classed by' +
' napi_is_error');
assert.strictEqual(test_error.checkError(theReferenceError), true);

// Test that native URI error object is correctly classed
assert.strictEqual(test_error.checkError(theURIError), true,
'URI error object correctly classed by napi_is_error');
assert.strictEqual(test_error.checkError(theURIError), true);

// Test that native eval error object is correctly classed
assert.strictEqual(test_error.checkError(theEvalError), true,
'Eval error object correctly classed by napi_is_error');
assert.strictEqual(test_error.checkError(theEvalError), true);

// Test that class derived from native error is correctly classed
assert.strictEqual(test_error.checkError(myError), true,
'Class derived from native error correctly classed by' +
' napi_is_error');
assert.strictEqual(test_error.checkError(myError), true);

// Test that non-error object is correctly classed
assert.strictEqual(test_error.checkError({}), false,
'Non-error object correctly classed by napi_is_error');
assert.strictEqual(test_error.checkError({}), false);

// Test that non-error primitive is correctly classed
assert.strictEqual(test_error.checkError('non-object'), false,
'Non-error primitive correctly classed by napi_is_error');
assert.strictEqual(test_error.checkError('non-object'), false);

assert.throws(() => {
test_error.throwExistingError();

0 comments on commit 9059b09

Please sign in to comment.
You can’t perform that action at this time.