Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): add disabledComponentsScan on server to resolve test issue
- Loading branch information
Showing
10 changed files
with
272 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
261 changes: 261 additions & 0 deletions
261
packages/cli/test/integrations/init/__snapshots__/init.integration.spec.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,261 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Init cmd Express.js should generate a project with Convention ANGULAR 1`] = ` | ||
"import {join} from \\"path\\"; | ||
import {Configuration, Inject} from \\"@tsed/di\\"; | ||
import {PlatformApplication} from \\"@tsed/common\\"; | ||
import \\"@tsed/platform-express\\"; // /!\\\\ keep this import | ||
import \\"@tsed/ajv\\"; | ||
import \\"@tsed/swagger\\"; | ||
import {config} from \\"./config/index\\"; | ||
import * as rest from \\"./controllers/rest/index\\"; | ||
import * as pages from \\"./controllers/pages/index\\"; | ||
@Configuration({ | ||
...config, | ||
acceptMimes: [\\"application/json\\"], | ||
httpPort: process.env.PORT || 8083, | ||
httpsPort: false, // CHANGE | ||
disableComponentsScan: true | ||
mount: { | ||
\\"/rest\\": [ | ||
...Object.values(rest) | ||
], | ||
\\"/\\": [ | ||
...Object.values(pages) | ||
] | ||
}, | ||
swagger: [ | ||
{ | ||
path: \\"/doc\\", | ||
specVersion: \\"3.0.1\\" | ||
} | ||
], | ||
middlewares: [ | ||
\\"cors\\", | ||
\\"cookie-parser\\", | ||
\\"compression\\", | ||
\\"method-override\\", | ||
\\"json-parser\\", | ||
{ use: \\"urlencoded-parser\\", options: { extended: true }} | ||
], | ||
views: { | ||
root: join(process.cwd(), \\"../views\\"), | ||
extensions: { | ||
ejs: \\"ejs\\" | ||
} | ||
}, | ||
exclude: [ | ||
\\"**/*.spec.ts\\" | ||
] | ||
}) | ||
export class Server { | ||
@Inject() | ||
protected app: PlatformApplication; | ||
@Configuration() | ||
protected settings: Configuration; | ||
} | ||
" | ||
`; | ||
|
||
exports[`Init cmd Express.js should generate a project with NPM 1`] = ` | ||
"import {join} from \\"path\\"; | ||
import {Configuration, Inject} from \\"@tsed/di\\"; | ||
import {PlatformApplication} from \\"@tsed/common\\"; | ||
import \\"@tsed/platform-express\\"; // /!\\\\ keep this import | ||
import \\"@tsed/ajv\\"; | ||
import {config} from \\"./config/index\\"; | ||
import * as rest from \\"./controllers/rest/index\\"; | ||
@Configuration({ | ||
...config, | ||
acceptMimes: [\\"application/json\\"], | ||
httpPort: process.env.PORT || 8083, | ||
httpsPort: false, // CHANGE | ||
disableComponentsScan: true | ||
mount: { | ||
\\"/rest\\": [ | ||
...Object.values(rest) | ||
] | ||
}, | ||
middlewares: [ | ||
\\"cors\\", | ||
\\"cookie-parser\\", | ||
\\"compression\\", | ||
\\"method-override\\", | ||
\\"json-parser\\", | ||
{ use: \\"urlencoded-parser\\", options: { extended: true }} | ||
], | ||
views: { | ||
root: join(process.cwd(), \\"../views\\"), | ||
extensions: { | ||
ejs: \\"ejs\\" | ||
} | ||
}, | ||
exclude: [ | ||
\\"**/*.spec.ts\\" | ||
] | ||
}) | ||
export class Server { | ||
@Inject() | ||
protected app: PlatformApplication; | ||
@Configuration() | ||
protected settings: Configuration; | ||
} | ||
" | ||
`; | ||
|
||
exports[`Init cmd Express.js should generate a project with swagger 1`] = ` | ||
"import {join} from \\"path\\"; | ||
import {Configuration, Inject} from \\"@tsed/di\\"; | ||
import {PlatformApplication} from \\"@tsed/common\\"; | ||
import \\"@tsed/platform-express\\"; // /!\\\\ keep this import | ||
import \\"@tsed/ajv\\"; | ||
import \\"@tsed/swagger\\"; | ||
import {config} from \\"./config/index\\"; | ||
import * as rest from \\"./controllers/rest/index\\"; | ||
import * as pages from \\"./controllers/pages/index\\"; | ||
@Configuration({ | ||
...config, | ||
acceptMimes: [\\"application/json\\"], | ||
httpPort: process.env.PORT || 8083, | ||
httpsPort: false, // CHANGE | ||
disableComponentsScan: true | ||
mount: { | ||
\\"/rest\\": [ | ||
...Object.values(rest) | ||
], | ||
\\"/\\": [ | ||
...Object.values(pages) | ||
] | ||
}, | ||
swagger: [ | ||
{ | ||
path: \\"/doc\\", | ||
specVersion: \\"3.0.1\\" | ||
} | ||
], | ||
middlewares: [ | ||
\\"cors\\", | ||
\\"cookie-parser\\", | ||
\\"compression\\", | ||
\\"method-override\\", | ||
\\"json-parser\\", | ||
{ use: \\"urlencoded-parser\\", options: { extended: true }} | ||
], | ||
views: { | ||
root: join(process.cwd(), \\"../views\\"), | ||
extensions: { | ||
ejs: \\"ejs\\" | ||
} | ||
}, | ||
exclude: [ | ||
\\"**/*.spec.ts\\" | ||
] | ||
}) | ||
export class Server { | ||
@Inject() | ||
protected app: PlatformApplication; | ||
@Configuration() | ||
protected settings: Configuration; | ||
} | ||
" | ||
`; | ||
|
||
exports[`Init cmd Express.js should generate a project with the right options 1`] = ` | ||
"import {join} from \\"path\\"; | ||
import {Configuration, Inject} from \\"@tsed/di\\"; | ||
import {PlatformApplication} from \\"@tsed/common\\"; | ||
import \\"@tsed/platform-express\\"; // /!\\\\ keep this import | ||
import \\"@tsed/ajv\\"; | ||
import {config} from \\"./config/index\\"; | ||
import * as rest from \\"./controllers/rest/index\\"; | ||
@Configuration({ | ||
...config, | ||
acceptMimes: [\\"application/json\\"], | ||
httpPort: process.env.PORT || 8083, | ||
httpsPort: false, // CHANGE | ||
disableComponentsScan: true | ||
mount: { | ||
\\"/rest\\": [ | ||
...Object.values(rest) | ||
] | ||
}, | ||
middlewares: [ | ||
\\"cors\\", | ||
\\"cookie-parser\\", | ||
\\"compression\\", | ||
\\"method-override\\", | ||
\\"json-parser\\", | ||
{ use: \\"urlencoded-parser\\", options: { extended: true }} | ||
], | ||
views: { | ||
root: join(process.cwd(), \\"../views\\"), | ||
extensions: { | ||
ejs: \\"ejs\\" | ||
} | ||
}, | ||
exclude: [ | ||
\\"**/*.spec.ts\\" | ||
] | ||
}) | ||
export class Server { | ||
@Inject() | ||
protected app: PlatformApplication; | ||
@Configuration() | ||
protected settings: Configuration; | ||
} | ||
" | ||
`; | ||
|
||
exports[`Init cmd Koa.js should generate a project with the right options 1`] = ` | ||
"import {join} from \\"path\\"; | ||
import {Configuration, Inject} from \\"@tsed/di\\"; | ||
import {PlatformApplication} from \\"@tsed/common\\"; | ||
import \\"@tsed/platform-koa\\"; // /!\\\\ keep this import | ||
import \\"@tsed/ajv\\"; | ||
import {config} from \\"./config/index\\"; | ||
import * as rest from \\"./controllers/rest/index\\"; | ||
@Configuration({ | ||
...config, | ||
acceptMimes: [\\"application/json\\"], | ||
httpPort: process.env.PORT || 8083, | ||
httpsPort: false, // CHANGE | ||
disableComponentsScan: true | ||
mount: { | ||
\\"/rest\\": [ | ||
...Object.values(rest) | ||
] | ||
}, | ||
middlewares: [ | ||
\\"@koa/cors\\", | ||
\\"koa-compress\\", | ||
\\"koa-override\\", | ||
\\"koa-bodyparser\\" | ||
], | ||
views: { | ||
root: join(process.cwd(), \\"../views\\"), | ||
extensions: { | ||
ejs: \\"ejs\\" | ||
} | ||
}, | ||
exclude: [ | ||
\\"**/*.spec.ts\\" | ||
] | ||
}) | ||
export class Server { | ||
@Inject() | ||
protected app: PlatformApplication; | ||
@Configuration() | ||
protected settings: Configuration; | ||
} | ||
" | ||
`; |
55 changes: 0 additions & 55 deletions
55
packages/cli/test/integrations/init/data/Server.express.swagger.ts.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.