代码之家  ›  专栏  ›  技术社区  ›  Phil

角度:从因果报应转到玩笑后,出现错误“无法识别CLI参数”

  •  0
  • Phil  · 技术社区  · 7 年前

    我将项目从Angular 6.4更新为Angular 7.1,现在运行脚本: ng test app-name --coverage 给我一个错误:

    ● Unrecognized CLI Parameters:
    
      Following options were not recognized:
      ["main", "polyfills", "tsConfig"]
    
      CLI Options Documentation:
      https://jestjs.io/docs/en/cli.html
    

    angular.json中test命令的配置如下所示:

    "test": {
      "builder": "@angular-builders/jest:run",
      "options": {
        "main": "apps/app-name/src/test.ts",
        "polyfills": "apps/app-name/src/polyfills.ts",
        "tsConfig": "apps/app-name/tsconfig.spec.json",
        "configPath": "./jest.config.json",
        "styles": [
          "apps/app-name/src/styles.scss"
        ],
        "scripts": [],
        "assets": [
          "apps/app-name/src/favicon.ico",
          "apps/app-name/src/assets"
        ]
      }
    },
    

    1 回复  |  直到 7 年前
        1
  •  0
  •   Phil    7 年前

    错误是,当我转到Jest时,我忘记删除/替换旧的karma builder配置。

    显然,Angular 7比Angular 6更能检查类似的东西(万岁!),所以我把它误认为是一只棱角分明或开玩笑的虫子。