Skip to content

Commit 2a6ca01

Browse files
cov(@nestjs) increase test coverage
1 parent 864fac9 commit 2a6ca01

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
## 4.5.2
2+
- **common**: [feature] rename `modules` to `imports` (`@Module()` decorator)
23
- **core**: [feature] exception filters with empty `@Catch()` metadata handle each occurred exception
34

45
## 4.5.1

src/common/test/decorators/module.decorator.spec.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,26 @@ describe('@Module', () => {
3636
InvalidModuleConfigException,
3737
);
3838
});
39+
40+
describe(`when "imports" is used`, () => {
41+
const imports = ['Imports'];
42+
@Module({
43+
imports,
44+
})
45+
class TestModule2 {}
46+
it(`should override "modules" metadata when there is no modules`, () => {
47+
const modules = Reflect.getMetadata('modules', TestModule2);
48+
expect(modules).to.be.eql(imports);
49+
});
50+
51+
@Module({
52+
...moduleProps,
53+
imports,
54+
})
55+
class TestModule3 {}
56+
it(`should not override "modules" metadata when there is no modules`, () => {
57+
const modules = Reflect.getMetadata('modules', TestModule3);
58+
expect(modules).to.be.eql(moduleProps.modules);
59+
});
60+
});
3961
});

src/core/router/router-explorer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ export class ExpressRouterExplorer implements RouterExplorer {
156156
requestMethod,
157157
);
158158
const exceptionFilter = this.exceptionsFilter.create(instance, callback);
159-
160159
return this.routerProxy.createProxy(executionContext, exceptionFilter);
161160
}
162161
}

0 commit comments

Comments
 (0)