'Karma skips Jasmine some spec files in nested Angular folders
I have Angular 13 project that was upgraded from Angular 9 or so and am configuring Karma to run specs. For some reason spec files from top folders only are executing, but after a certain depth of folders is reached, specs stop from running.
for example
src\app\modules\dialog-manager is a module folder
src\app\modules\dialog-manager\debugging-dialogmgr.spec.ts - module-folder spec runs
src\app\modules\dialog-manager\dialog-content\debugging-dialogmgr.spec.ts - this spec does not run (describe uses different name for spec)
src\app\modules\dialog-manager\dialog-manager\debugging-dialogcnt.spec.ts - this spec does not run.
Module has index.ts to propogate up types from typescript classes. src\app\modules\dialog-manager does have index.ts that contains:
export * from './dialog-content';
export * from './dialog-manager';
Nothing in index.ts files is spec-related.
If I intentionally make typos in specs in not running spec files I see Karma picking the errors up, so at least compilation is happening.
What could be wrong?
Solution 1:[1]
So, it turned out to be circular dependency that originally have not been seemingly propagating to Karma web UI but were printing in logs. After partial CD fix I began seeing "loading error" in browser and working through CDs was able to make remaining specs engage.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ben92 |
