Skip to content

Commit 32911d5

Browse files
committed
assert the test server.ts
1 parent 216ae70 commit 32911d5

File tree

15 files changed

+16
-16
lines changed

15 files changed

+16
-16
lines changed

tests/fixtures/custom/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ app.use((req: any, res: any, next: express.NextFunction) => {
2727
req.stringValue = 'fancyStringForContext';
2828
next();
2929
});
30-
RegisterRoutes(app);
30+
(RegisterRoutes as (app: express.Express) => void)(app);
3131

3232
// It's important that this come after the main routes are registered
3333
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {

tests/fixtures/express-dynamic-controllers/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ app.use((req: any, res: any, next: express.NextFunction) => {
1414
req.stringValue = 'fancyStringForContext';
1515
next();
1616
});
17-
RegisterRoutes(app);
17+
(RegisterRoutes as (app: express.Express) => void)(app);
1818

1919
// It's important that this come after the main routes are registered
2020
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {

tests/fixtures/express-openapi3/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ app.use((req: any, res: any, next: express.NextFunction) => {
3030
req.stringValue = 'fancyStringForContext';
3131
next();
3232
});
33-
RegisterRoutes(app);
33+
(RegisterRoutes as (app: express.Express) => void)(app);
3434

3535
// It's important that this come after the main routes are registered
3636
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {

tests/fixtures/express-root-security/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { RegisterRoutes } from './routes';
88
export const app: express.Express = express();
99
app.use(bodyParser.urlencoded({ extended: true }));
1010
app.use(bodyParser.json());
11-
RegisterRoutes(app);
11+
(RegisterRoutes as (app: express.Express) => void)(app);
1212

1313
// It's important that this come after the main routes are registered
1414
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {

tests/fixtures/express-router-with-custom-multer/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ router.use((req: any, res: any, next: express.NextFunction) => {
2020

2121
import multer = require('multer');
2222

23-
RegisterRoutes(router, {
23+
(RegisterRoutes as (router: express.Router, options: { multer: ReturnType<typeof multer> }) => void)(router, {
2424
multer: multer({
2525
limits: {
2626
fieldNameSize: 120,

tests/fixtures/express-router/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ router.use((req: any, res: any, next: express.NextFunction) => {
1818
next();
1919
});
2020

21-
RegisterRoutes(router);
21+
(RegisterRoutes as (router: express.Router) => void)(router);
2222

2323
// It's important that this come after the main routes are registered
2424
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {

tests/fixtures/express/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ app.use((req: any, res: any, next: express.NextFunction) => {
3838
req.stringValue = 'fancyStringForContext';
3939
next();
4040
});
41-
RegisterRoutes(app);
41+
(RegisterRoutes as (app: express.Express) => void)(app);
4242

4343
// It's important that this come after the main routes are registered
4444
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {

tests/fixtures/hapi/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Server } from '@hapi/hapi';
1+
import { Server, ServerApplicationState } from '@hapi/hapi';
22
import '../controllers/rootController';
33

44
import '../controllers/optionsController';
@@ -23,7 +23,7 @@ import { RegisterRoutes } from './routes';
2323

2424
export const server = new Server({});
2525

26-
RegisterRoutes(server);
26+
(RegisterRoutes as (app: Server<ServerApplicationState>) => void)(server);
2727

2828
server.start().catch(err => {
2929
if (err) {

tests/fixtures/inversify-async/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ app.use(bodyParser.json());
1212
app.use((req, res, next) => {
1313
methodOverride()(req, res, next);
1414
});
15-
RegisterRoutes(app);
15+
(RegisterRoutes as (app: express.Router) => void)(app);
1616

1717
// It's important that this come after the main routes are registered
1818
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {

tests/fixtures/inversify-cpg/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ app.use(bodyParser.json());
1111
app.use((req, res, next) => {
1212
methodOverride()(req, res, next);
1313
});
14-
RegisterRoutes(app);
14+
(RegisterRoutes as (app: express.Express) => void)(app);
1515

1616
// It's important that this come after the main routes are registered
1717
app.use((err: any, req: express.Request, res: express.Response, next: express.NextFunction) => {

0 commit comments

Comments
 (0)