I recently created a new Angular project using the latest Angular 15 CLI. Now I want to add ng-mocks to it.
I can install the dependency, but there is no longer a test.ts file where I can add the configuration for ng-mocks. When I add the file myself, my tests are no longer found.
What is the proper way to add ng-mocks to an Angular 15 project without test.ts?
now
test.tsis generated by angular (node_modules/@angular-devkit/build-angular/src/builders/karma/index.js), if you want to customize it, you need to do the next:create
src/test.tsand put there:Then add it to
angular.json:and add it to
tsconfig.spec.ts:profit, now you can extend
test.tsagain.