title: Angular 14.2 unit testing doesn't find spec when running ng test or npm test
body: <p>I'm trying for the first time to configure unit testing in my Angular 14 project but i got Incomplete: No specs found, , randomized with seed 69677.</p>
  <p>Here's my configurations files</p>
  <p>tsconfig.spec.json</p>
  <pre><code>{
    &quot;extends&quot;: &quot;./tsconfig.json&quot;,
    &quot;compilerOptions&quot;: {
      &quot;outDir&quot;: &quot;./out-tsc/spec&quot;,
      &quot;types&quot;: [
        &quot;jasmine&quot;,
        &quot;node&quot;
      ],
      &quot;typeRoots&quot;: [&quot;node_modules/@types&quot;]
    },
    &quot;files&quot;: [
      &quot;src/test.ts&quot;,
      &quot;src/polyfills.ts&quot;
    ],
    &quot;include&quot;: [
      &quot;src/**/*.spec.ts&quot;,
      &quot;src/**/*.d.ts&quot;,
    ]
  }
  </code></pre>
  <p>package.json</p>
  <pre><code>{
    &quot;name&quot;: &quot;project-test&quot;,
    &quot;version&quot;: &quot;0.2.0&quot;,
    &quot;scripts&quot;: {
      &quot;ng&quot;: &quot;ng&quot;,
      &quot;start&quot;: &quot;ng serve&quot;,
      &quot;build&quot;: &quot;ng build&quot;,
      &quot;watch&quot;: &quot;ng build --watch --configuration development&quot;,
      &quot;test&quot;: &quot;ng test&quot;
    },
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@angular-builders/custom-webpack&quot;: &quot;^14.0.1&quot;,
      &quot;@angular-material-components/color-picker&quot;: &quot;^8.0.0&quot;,
      &quot;@angular/animations&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/cdk&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/common&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/compiler&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/core&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/flex-layout&quot;: &quot;^14.0.0-beta.40&quot;,
      &quot;@angular/forms&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/material&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/platform-browser&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/platform-browser-dynamic&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/router&quot;: &quot;^14.2.2&quot;,
      &quot;@fortawesome/angular-fontawesome&quot;: &quot;^0.11.1&quot;,
      &quot;@fortawesome/fontawesome-svg-core&quot;: &quot;^6.2.0&quot;,
      &quot;@fortawesome/free-brands-svg-icons&quot;: &quot;^6.2.0&quot;,
      &quot;@fortawesome/free-solid-svg-icons&quot;: &quot;^6.2.0&quot;,
      &quot;@ngx-translate/core&quot;: &quot;^14.0.0&quot;,
      &quot;@ngx-translate/http-loader&quot;: &quot;^7.0.0&quot;,
      &quot;angular-star-rating&quot;: &quot;^6.0.0&quot;,
      &quot;chart.js&quot;: &quot;^3.9.1&quot;,
      &quot;css-star-rating&quot;: &quot;^1.3.1&quot;,
      &quot;jsmind&quot;: &quot;^0.4.8&quot;,
      &quot;json-ignore&quot;: &quot;^0.4.0&quot;,
      &quot;keycloak-angular&quot;: &quot;^12.1.0&quot;,
      &quot;keycloak-js&quot;: &quot;^18.0.1&quot;,
      &quot;ng2-charts&quot;: &quot;^4.0.0&quot;,
      &quot;ngx-sharebuttons&quot;: &quot;^11.0.0&quot;,
      &quot;rxjs&quot;: &quot;~7.5.6&quot;,
      &quot;tslib&quot;: &quot;^2.4.0&quot;,
      &quot;webpack&quot;: &quot;^5.74.0&quot;,
      &quot;zone.js&quot;: &quot;~0.11.8&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@angular-devkit/build-angular&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/cli&quot;: &quot;^14.2.2&quot;,
      &quot;@angular/compiler-cli&quot;: &quot;^14.2.2&quot;,
      &quot;@types/jasmine&quot;: &quot;~4.3.0&quot;,
      &quot;@types/node&quot;: &quot;^14.17.0&quot;,
      &quot;brotli-webpack-plugin&quot;: &quot;^1.1.0&quot;,
      &quot;jasmine&quot;: &quot;^4.4.0&quot;,
      &quot;jasmine-core&quot;: &quot;~4.4.0&quot;,
      &quot;karma&quot;: &quot;~6.4.1&quot;,
      &quot;karma-chrome-launcher&quot;: &quot;~3.1.1&quot;,
      &quot;karma-coverage&quot;: &quot;~2.2.0&quot;,
      &quot;karma-jasmine&quot;: &quot;~5.1.0&quot;,
      &quot;karma-jasmine-html-reporter&quot;: &quot;~ 2.0.0&quot;,
      &quot;typescript&quot;: &quot;~4.7.4&quot;
    }
  }
  </code></pre>
  <p>In the console i've got errors but I don't know how to fix them.</p>
  <pre><code>ng test
  
  ⠹ Generating browser application bundles (phase: setup)...
  - @angular/core [es2015/esm2015] (https://github.com/angular/angular.git)
  ✔ Browser application bundle generation complete.
  
  ./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
  Error: Emit attempted before Angular Webpack plugin initialization.
  
  ./src/test.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
  Error: Emit attempted before Angular Webpack plugin initialization.
  
  Error: Failed to initialize Angular compilation - Cannot read property 'fileName' of null
  
  
  20 09 2022 10:33:28.619:WARN [karma]: No captured browser, open http://localhost:9876/
  20 09 2022 10:33:28.644:INFO [karma-server]: Karma v6.4.1 server started at http://localhost:9876/
  20 09 2022 10:33:28.644:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
  20 09 2022 10:33:28.649:INFO [launcher]: Starting browser Chrome
  20 09 2022 10:33:29.770:INFO [Chrome 105.0.0.0 (Windows 10)]: Connected on socket LsDl3VzOpNHgg8p_AAAB with id 15088237
  20 09 2022 10:33:29.822:WARN [web-server]: 404: /_karma_webpack_/main.js
  Chrome 105.0.0.0 (Windows 10): Executed 0 of 0 SUCCESS (0.014 secs / 0 secs)
  TOTAL: 0 SUCCESS
  </code></pre>
  <p>How could I fix those console errors ?</p>