Skip to content

Commit

Permalink
test: remove template literal
Browse files Browse the repository at this point in the history
PR-URL: #15953
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
emilyford authored and MylesBorins committed Oct 11, 2017
1 parent ba9aa46 commit 9059b09
Showing 1 changed file with 10 additions and 22 deletions.
32 changes: 10 additions & 22 deletions test/addons-napi/test_error/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9059b09

Please sign in to comment.