Skip to content

Commit 7aff758

Browse files
author
kamil.mysliwiec
committed
Tests fix
1 parent 5f635c2 commit 7aff758

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

example/app.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
import * as morgan from 'morgan';
21
import { NestApplication } from './../src/';
3-
import * as bodyParser from 'body-parser';
42

53
export class Application implements NestApplication {
64

7-
constructor(private expressApp) {
8-
expressApp.use(morgan('tiny'));
9-
expressApp.use(bodyParser.json());
10-
}
5+
constructor(private expressApp) {}
116

127
start() {
138
const server = this.expressApp.listen(3030, () => {

src/core/test/middlewares/middlewares-module.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import { NestMiddleware } from '../../middlewares/interfaces/nest-middleware.int
44
import { Component } from '../../../common/utils/component.decorator';
55
import { MiddlewareBuilder } from '../../middlewares/builder';
66
import { MiddlewaresModule } from '../../middlewares/middlewares-module';
7-
import { UnkownMiddlewareException } from '../../../errors/exceptions/unkown-middleware.exception';
87
import { InvalidMiddlewareException } from '../../../errors/exceptions/invalid-middleware.exception';
98
import { RequestMethod } from '../../../common/enums/request-method.enum';
109
import { Controller } from '../../../common/utils/controller.decorator';
1110
import { RequestMapping } from '../../../common/utils/request-mapping.decorator';
11+
import { RuntimeException } from '../../../errors/exceptions/runtime.exception';
1212

1313
describe('MiddlewaresModule', () => {
1414
@Controller({ path: 'test' })
@@ -48,7 +48,7 @@ describe('MiddlewaresModule', () => {
4848

4949
describe('setupRouteMiddleware', () => {
5050

51-
it('should throw "UnkownMiddlewareException" exception when middlewares is not stored in container', () => {
51+
it('should throw "RuntimeException" exception when middlewares is not stored in container', () => {
5252
const route = { path: 'Test' };
5353
const configuration = {
5454
middlewares: [ TestMiddleware ],
@@ -60,7 +60,7 @@ describe('MiddlewaresModule', () => {
6060

6161
expect(MiddlewaresModule.setupRouteMiddleware.bind(
6262
MiddlewaresModule, route, configuration, <any>'Test', <any>app
63-
)).throws(UnkownMiddlewareException);
63+
)).throws(RuntimeException);
6464
});
6565

6666
it('should throw "InvalidMiddlewareException" exception when middlewares does not have "resolve" method', () => {

0 commit comments

Comments
 (0)