Skip to content

Commit eb0723c

Browse files
Merge pull request nestjs#3591 from tonyhallett/scanner-expectation-in-catch
test(core): fix expectation in catch
2 parents feaf750 + ff1f732 commit eb0723c

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

packages/core/test/scanner.spec.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,14 @@ describe('DependenciesScanner', () => {
168168
expect(module.forwardRef.called).to.be.true;
169169
});
170170
describe('when "related" is nil', () => {
171-
it('should throw exception', () => {
172-
scanner
173-
.insertImport(undefined, [] as any, 'test')
174-
.catch(err => expect(err).to.not.be.undefined);
171+
it('should throw exception', async () => {
172+
let error;
173+
try {
174+
await scanner.insertImport(undefined, [] as any, 'test');
175+
} catch (e) {
176+
error = e;
177+
}
178+
expect(error).to.not.be.undefined;
175179
});
176180
});
177181
});

0 commit comments

Comments
 (0)