2

In my project we use the angular CLI to generate new components and services, but we'd like to move the tests into their own root directory that mirrors the sourceRoot src.

For example, instead of:

> ng generate service shared/services/test-service --dry-run
CREATE src/app/shared/services/test-service.service.spec.ts (359 bytes)
CREATE src/app/shared/services/test-service.service.ts (140 bytes)

The output would be

> ng generate service shared/services/test-service --dry-run
CREATE test/app/shared/services/test-service.service.spec.ts (359 bytes)
CREATE test/app/shared/services/test-service.service.ts (140 bytes)

I have looked through the documentation for a configuration option to specify this behavior and haven't found anything. Does anyone know of a solution to this?

Here's the version information in case it's relevant:

Angular CLI: 7.2.3
Node: 8.10.0
OS: darwin x64
Angular: 7.1.4
Andy Groff
  • 2,660
  • 1
  • 21
  • 25
  • Have you found a solution for your case? – Kosmonaft Jul 09 '19 at 02:55
  • No @Kosmonaft we decided that if it is this difficult to mirror the directories (not possible without a hack?) we are better off to keep our project consistent with how the angular designers intended. – Andy Groff Jul 16 '19 at 20:55

0 Answers0