Generating component without spec.ts in Angular within nx workspace

48 Views Asked by At

I want to do it for the entire project, but unlike an Angular CLI project, there is no angular.json file, only a project.json one.

So, according to this answer, I could add some config somewhere to enable the skipTests property, but I tried in the project.json with no success, so how can I do it ?

Note : I use nx version 15.8.5.

1

There are 1 best solutions below

1
Andrew Allen On BEST ANSWER

You can specify defaults in nx.json:

{
  ...
  "generators": {
    ...
    "@nx/angular:component": {
      "style": "scss",
      "standalone": true,
      "changeDetection": "OnPush",
      "displayBlock": true,
      "flat": true,
      "inlineStyle": true,
      "inlineTemplate": true,
      "skipTests": true
    },
    ...

If you use Nx Console (I recommend) then these will also be used.