chihab / dotenv-run

Seamlessly load environment variables. Supports cli, esbuild, rollup, vite, webpack, angular. ESM and Monorepos.
246 stars 17 forks source link

ng test error: Data path "" should NOT have additional properties(configPath). #13

Closed BrothersWar closed 2 years ago

BrothersWar commented 2 years ago

package version: 1.1.0 angular version: 11 Error:

Schema validation failed with the following errors:   
Data path "" should NOT have additional properties(configPath).

Error occurs when i run command: ng test. I think it's because my angular.json missing some properties

chihab commented 2 years ago

Are you getting the same issue when running this command?

cd /tmp && V=11 && npx @angular/cli@$V new ng-app$V --defaults && cd ng-app$V && npx ng add @ngx-env/builder@1.1.0 && npm run test -- --watch=false

The command generates a new app using CLI v11, adds @ngx-env/builder v1.1.0 then runs tests on it.

If it is all green (it should be), you can compare your project's angular.json with the one inside /tmp/ng-app11 to see what could be wrong.

BrothersWar commented 2 years ago

ye your command is working. what if i not need all properties from your angular.json. my test in angular.json:

        "test": {
          "builder": "@angular-builders/jest:run",
          "options": {
            "configPath": "jest.config.js"
          }
        },
chihab commented 2 years ago

You are not using @ngx-env/builder here :) Right now @ngx-env/builder only supports CLI builders. Could you copy/paste your angular.json and the output you get on your Terminal here?

chihab commented 2 years ago

Closing the issue as not related to @ngx-env/builder.