3

angular 7 + angular cli 7.1.0

upgraded project from angular 5 to 7 and when run ng test

and tsConfig added in angular.json file

` "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "test.js",
            "karmaConfig": "./karma.conf.js",
            "polyfills": "apps/app/src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",`

I get the output Schema validation failed with the following errors: Data path "" should have required property 'tsConfig'.

What am I doing wrong? Thanks in advance.

Antu
  • 2,197
  • 3
  • 25
  • 40
avni
  • 31
  • 2

2 Answers2

2

Your path of the tsConfig is wrong. Change it to

"tsConfig": "apps/app/src/tsconfig.spec.json"
bat7
  • 836
  • 1
  • 8
  • 22
1

In my angular 7 project ng test is working. below is my agular.json file test configuration.

   "test": {
      "builder": "@angular-devkit/build-angular:karma",
      "options": {
        "main": "src/test.ts",
        "karmaConfig": "./karma.conf.js",
        "polyfills": "src/polyfills.ts",
        "tsConfig": "src/tsconfig.spec.json",
        "scripts": [
          "src/assets/jquery-3.2.1.min.js",
          "src/assets/vendor/bootstrap/js/bootstrap.min.js",
        ],
        "styles": [
          "src/assets/vendor/bootstrap/css/bootstrap.css",
        ],
        "assets": [
          "src/assets",
          "src/favicon.ico"
        ]
      }
    },
Dinesh Hiregange
  • 103
  • 1
  • 10