Skip to content

Commit

Permalink
cov(@nestjs) increase test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Dec 21, 2017
1 parent 864fac9 commit 2a6ca01
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## 4.5.2
- **common**: [feature] rename `modules` to `imports` (`@Module()` decorator)
- **core**: [feature] exception filters with empty `@Catch()` metadata handle each occurred exception

## 4.5.1
Expand Down
22 changes: 22 additions & 0 deletions src/common/test/decorators/module.decorator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,26 @@ describe('@Module', () => {
InvalidModuleConfigException,
);
});

describe(`when "imports" is used`, () => {
const imports = ['Imports'];
@Module({
imports,
})
class TestModule2 {}
it(`should override "modules" metadata when there is no modules`, () => {
const modules = Reflect.getMetadata('modules', TestModule2);
expect(modules).to.be.eql(imports);
});

@Module({
...moduleProps,
imports,
})
class TestModule3 {}
it(`should not override "modules" metadata when there is no modules`, () => {
const modules = Reflect.getMetadata('modules', TestModule3);
expect(modules).to.be.eql(moduleProps.modules);
});
});
});
1 change: 0 additions & 1 deletion src/core/router/router-explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ export class ExpressRouterExplorer implements RouterExplorer {
requestMethod,
);
const exceptionFilter = this.exceptionsFilter.create(instance, callback);

return this.routerProxy.createProxy(executionContext, exceptionFilter);
}
}
Expand Down

0 comments on commit 2a6ca01

Please sign in to comment.