Skip to content

Commit 04af56c

Browse files
committed
Better error checking
1 parent 7448e79 commit 04af56c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/product-create.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ describe('product create ', () => {
6363

6464
await expect(productService.create(productMissingName))
6565
.rejects
66-
.toBeInstanceOf(mongoose.Error.ValidationError);
66+
.toThrow(mongoose.Error.ValidationError);
6767

6868
await expect(productService.create(productMissingPrice))
6969
.rejects
70-
.toBeInstanceOf(mongoose.Error.ValidationError);
70+
.toThrow(mongoose.Error.ValidationError);
7171
});
7272
});
7373

0 commit comments

Comments
 (0)