Skip to content

Commit

Permalink
fix: Update adapter tests to not rely on error instance (#1202)
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl authored Feb 9, 2019
1 parent b33fbcc commit 6885e0e
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions packages/adapter-tests/lib/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Got a NotFound Feathers error'
);
}
Expand All @@ -59,7 +59,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
await service.get('568225fbfe21222432e836ff');
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Error is a NotFound Feathers error'
);
}
Expand All @@ -77,7 +77,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Got a NotFound Feathers error'
);
}
Expand Down Expand Up @@ -118,7 +118,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Got a NotFound Feathers error'
);
}
Expand Down Expand Up @@ -167,7 +167,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Got a NotFound Feathers error'
);
}
Expand Down Expand Up @@ -217,7 +217,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Got a NotFound Feathers error'
);
}
Expand All @@ -228,7 +228,9 @@ module.exports = (test, app, errors, serviceName, idProp) => {
await service.update('568225fbfe21222432e836ff', { name: 'NotFound' });
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound, 'Error is a NotFound Feathers error');
assert.strictEqual(error.name, 'NotFound',
'Error is a NotFound Feathers error'
);
}
});

Expand All @@ -247,7 +249,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Got a NotFound Feathers error'
);
}
Expand Down Expand Up @@ -293,7 +295,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Got a NotFound Feathers error'
);
}
Expand Down Expand Up @@ -370,7 +372,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
await service.patch('568225fbfe21222432e836ff', { name: 'PatchDoug' });
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Error is a NotFound Feathers error'
);
}
Expand All @@ -390,7 +392,7 @@ module.exports = (test, app, errors, serviceName, idProp) => {
});
throw new Error('Should never get here');
} catch (error) {
assert.ok(error instanceof errors.NotFound,
assert.strictEqual(error.name, 'NotFound',
'Got a NotFound Feathers error'
);
}
Expand Down

0 comments on commit 6885e0e

Please sign in to comment.