-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
generate.controller.integration.spec.ts.snap
51 lines (45 loc) 路 1.24 KB
/
generate.controller.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
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Generate DataSource should generate the template with the right options (simple path) 1`] = `
"import {registerProvider} from \\"@tsed/di\\";
import {DataSource} from \\"typeorm\\";
import {Logger} from \\"@tsed/logger\\";
export const TEST_DATASOURCE = Symbol.for(\\"TestDatasource\\");
export const TestDatasource = new DataSource({
type: \\"mysql\\",
entities: [],
host: \\"localhost\\",
port: 3306,
username: \\"test\\",
password: \\"test\\",
database: \\"test\\"
});
registerProvider<DataSource>({
provide: TEST_DATASOURCE,
type: \\"typeorm:datasource\\",
deps: [Logger],
async useAsyncFactory(logger: Logger) {
await TestDatasource.initialize();
logger.info(\\"Connected with typeorm to database: Test\\");
return TestDatasource;
},
hooks: {
$onDestroy(dataSource) {
return dataSource.isInitialized && dataSource.close();
}
}
});
"
`;
exports[`Generate DataSource should generate the template with the right options (simple path) 2`] = `
"services:
test:
image: mysql:8.0.28-oracle
ports:
- '3306:3306'
environment:
MYSQL_ROOT_PASSWORD: admin
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_DATABASE: test
"
`;