-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
init.integration.spec.ts.snap
77 lines (72 loc) 路 1.83 KB
/
init.integration.spec.ts.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Init TypeGraphQL project should generate a project with typegraphql 2`] = `
"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/typegraphql\\";
import \\"./datasources/index\\";
import \\"./resolvers/index\\";
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,
ajv: {
returnsCoercedValues: 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 TypeGraphQL project should generate a project with typegraphql 3`] = `
"import {readFileSync} from \\"fs\\";
import {envs} from \\"./envs/index\\";
import loggerConfig from \\"./logger/index\\";
const pkg = JSON.parse(readFileSync(\\"./package.json\\", {encoding: \\"utf8\\"}));
export const config: Partial<TsED.Configuration> = {
version: pkg.version,
envs,
logger: loggerConfig,
graphql: {
default: {
path: \\"/graphql\\",
buildSchemaOptions: {
}
}
},
// additional shared configuration
};
"
`;