refactor of spec file
This commit is contained in:
parent
be85c784ed
commit
d8075a09e2
|
@ -20,14 +20,14 @@ describe('item clone()', () => {
|
|||
});
|
||||
|
||||
it('should attempt to clone the given item but give an error as it doesnt exist', async() => {
|
||||
let result;
|
||||
try {
|
||||
let itemFk = 999;
|
||||
result = await app.models.Item.clone(itemFk);
|
||||
} catch (error) {
|
||||
expect(error.toString()).toContain('Cannot convert undefined or null to object');
|
||||
}
|
||||
let error;
|
||||
let itemFk = 999;
|
||||
await app.models.Item.clone(itemFk)
|
||||
.catch(e => {
|
||||
expect(e.message).toContain('Cannot convert undefined or null to object');
|
||||
error = e;
|
||||
});
|
||||
|
||||
expect(result).toBeFalsy();
|
||||
expect(error).toBeDefined();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue