Angular UnitTest inner spec files not consider and also fdescribe, xdescribe, fit and xit not working

38 views Asked by At

When we run Angular Application UnitTest with ng test not running all test cases even adding fdescribe, xdescribe, fit and xit not considered

Example: deeppath is not considered 1.src\app\modules\sample\sample.spec.ts considered 2.src\app\modules\sample\example\example.spec.ts not considered

I tried changing below file tsconfig.spec.json

1. "include": [ "src/**/*.spec.ts", "src/**/*.d.ts" ]

2."include": [ "**/*.spec.ts", "**/*.d.ts" ] 3."include": [ "*.spec.ts", "*.d.ts" ]

1

There are 1 answers

0
AliF50 On

In test.ts, can you look for this line and ensure that the regular expression is accurate and it should find all of your tests?

...
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);