the test now fails if the tests fails to get into the catch and an item gets cloned
This commit is contained in:
parent
8228f49eed
commit
1a7930308c
|
@ -20,11 +20,14 @@ describe('item clone()', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should attempt to clone the given item but give an error as it doesnt exist', async() => {
|
it('should attempt to clone the given item but give an error as it doesnt exist', async() => {
|
||||||
|
let result;
|
||||||
try {
|
try {
|
||||||
let itemFk = 999;
|
let itemFk = 999;
|
||||||
await app.models.Item.clone(itemFk);
|
result = await app.models.Item.clone(itemFk);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
expect(error.toString()).toContain('Cannot convert undefined or null to object');
|
expect(error.toString()).toContain('Cannot convert undefined or null to object');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
expect(result).toBeFalsy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue