1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-10 11:43:01 +03:00

Inherit the name property in the error classes

This commit is contained in:
Ruben Bridgewater
2016-05-31 15:11:57 +02:00
parent c1f7755142
commit a0c7431787
2 changed files with 15 additions and 14 deletions

View File

@@ -24,11 +24,11 @@ describe('errors', function () {
assert.strictEqual(e.message, 'hello world');
assert.strictEqual(e.name, 'weird');
assert.strictEqual(e.property, true);
assert.strictEqual(Object.keys(e).length, 1);
assert.strictEqual(Object.keys(e).length, 2);
assert(e instanceof Error);
assert(e instanceof errors.AbortError);
assert(delete e.name);
assert.strictEqual(e.name, 'Error');
assert.strictEqual(e.name, 'AbortError');
});
it('should change name and message', function () {
@@ -65,12 +65,12 @@ describe('errors', function () {
assert.strictEqual(e.message, 'hello world');
assert.strictEqual(e.name, 'weird');
assert.strictEqual(e.property, true);
assert.strictEqual(Object.keys(e).length, 1);
assert.strictEqual(Object.keys(e).length, 2);
assert(e instanceof Error);
assert(e instanceof errors.AggregateError);
assert(e instanceof errors.AbortError);
assert(delete e.name);
assert.strictEqual(e.name, 'Error');
assert.strictEqual(e.name, 'AggregateError');
});
it('should change name and message', function () {