MCPcopy
hub / github.com/nestjs/nest / compile

Method compile

packages/testing/testing-module.builder.ts:97–132  ·  view source on GitHub ↗
(
    options: Pick<NestApplicationContextOptions, 'snapshot' | 'preview'> = {},
  )

Source from the content-addressed store, hash-verified

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) => {

Callers

nothing calls this directly

Calls 7

applyLoggerMethod · 0.95
scanMethod · 0.95
getModuleOverloadsMethod · 0.95
applyOverloadsMapMethod · 0.95
getRootModuleMethod · 0.95

Tested by

no test coverage detected