(
options: Pick<NestApplicationContextOptions, 'snapshot' | 'preview'> = {},
)
| 95 | } |
| 96 | |
| 97 | public async compile( |
| 98 | options: Pick<NestApplicationContextOptions, 'snapshot' | 'preview'> = {}, |
| 99 | ): Promise<TestingModule> { |
| 100 | this.applyLogger(); |
| 101 | |
| 102 | let graphInspector: GraphInspector; |
| 103 | if (options?.snapshot) { |
| 104 | graphInspector = new GraphInspector(this.container); |
| 105 | UuidFactory.mode = UuidFactoryMode.Deterministic; |
| 106 | } else { |
| 107 | graphInspector = NoopGraphInspector; |
| 108 | UuidFactory.mode = UuidFactoryMode.Random; |
| 109 | } |
| 110 | |
| 111 | const scanner = new DependenciesScanner( |
| 112 | this.container, |
| 113 | this.metadataScanner, |
| 114 | graphInspector, |
| 115 | this.applicationConfig, |
| 116 | ); |
| 117 | await scanner.scan(this.module, { |
| 118 | overrides: this.getModuleOverloads(), |
| 119 | }); |
| 120 | |
| 121 | this.applyOverloadsMap(); |
| 122 | await this.createInstancesOfDependencies(graphInspector, options); |
| 123 | scanner.applyApplicationProviders(); |
| 124 | |
| 125 | const root = this.getRootModule(); |
| 126 | return new TestingModule( |
| 127 | this.container, |
| 128 | graphInspector, |
| 129 | root, |
| 130 | this.applicationConfig, |
| 131 | ); |
| 132 | } |
| 133 | |
| 134 | private override<T = any>(typeOrToken: T, isProvider: boolean): OverrideBy { |
| 135 | const addOverload = (options: any) => { |
nothing calls this directly
no test coverage detected