Skip to content

Commit a07eb70

Browse files
committed
fix(demo): Resolve @angular/core/testing in the app specs
The three demo app specs have never run: all of them failed to compile with TS2307 on '@angular/core/testing'. That subpath exists only in the package's `exports` map -- there is no testing/ directory and no top-level fallback the way there is for the package root -- and tsconfig.base.json sets `moduleResolution: node`, which predates `exports` and cannot see it. Switch the spec configs to bundler resolution, which reads `exports`. It requires `module` to be es2015 or later, so that moves to esnext; jest-preset-angular emits CommonJS either way, which is why the suites now run. Only the specs are affected. The app builds go through Angular's builder, which brings its own resolution, and no other project imports an exports-only subpath -- libs/mf-tools only ever imports the @angular/core root, which still resolves through the package's top-level `typings`.
1 parent 0c375f7 commit a07eb70

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

apps/mfe1/tsconfig.spec.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
5-
"module": "commonjs",
5+
// `@angular/core/testing` is reachable only through the package's `exports`
6+
// map, which the inherited `moduleResolution: node` cannot read. Bundler
7+
// resolution can, and it requires `module` to be es2015 or later —
8+
// jest-preset-angular emits CommonJS regardless.
9+
"module": "esnext",
10+
"moduleResolution": "bundler",
611
"types": ["jest", "node"]
712
},
813
"files": ["src/test-setup.ts"],

apps/mfe2/tsconfig.spec.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
5-
"module": "commonjs",
5+
// `@angular/core/testing` is reachable only through the package's `exports`
6+
// map, which the inherited `moduleResolution: node` cannot read. Bundler
7+
// resolution can, and it requires `module` to be es2015 or later —
8+
// jest-preset-angular emits CommonJS regardless.
9+
"module": "esnext",
10+
"moduleResolution": "bundler",
611
"types": ["jest", "node"]
712
},
813
"files": ["src/test-setup.ts"],

apps/shell/tsconfig.spec.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
"extends": "./tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../dist/out-tsc",
5-
"module": "commonjs",
5+
// `@angular/core/testing` is reachable only through the package's `exports`
6+
// map, which the inherited `moduleResolution: node` cannot read. Bundler
7+
// resolution can, and it requires `module` to be es2015 or later —
8+
// jest-preset-angular emits CommonJS regardless.
9+
"module": "esnext",
10+
"moduleResolution": "bundler",
611
"types": ["jest", "node"]
712
},
813
"files": ["src/test-setup.ts"],

0 commit comments

Comments
 (0)