Skip to content

Commit 2c8479d

Browse files
Merge pull request nestjs#3585 from tonyhallett/use-interceptors-expect-in-catch
test(common): correct expectation in catch
2 parents 5f77504 + 2069aae commit 2c8479d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/common/test/decorators/use-interceptors.decorator.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ describe('@UseInterceptors', () => {
3030
});
3131

3232
it('when object is invalid should throw exception', () => {
33+
let error = undefined;
3334
try {
34-
UseInterceptors('test' as any)({});
35+
UseInterceptors('test' as any)({ name: 'target' });
3536
} catch (e) {
36-
expect(e).to.be.instanceof(InvalidDecoratorItemException);
37+
error = e;
3738
}
39+
expect(error).to.be.instanceof(InvalidDecoratorItemException);
3840
});
3941

4042
it('when object is valid should not throw exception', () => {

0 commit comments

Comments
 (0)