Jest + IntelliJ(IDEA)=>错误:async()测试助手需要区域,但找不到

时间:2019-04-05 05:57:43

标签: angular intellij-idea jestjs webstorm

当我从命令行在Angular-Lib上运行Jest-Unit测试时,它们工作正常。当我在单独的测试中从IntelliJ(版本2019.1)运行它们时,它们仅在不使用async()的情况下才起作用。

这很奇怪,因为我的angular.json包含以下内容:

<select name="_sft_location[]" class="sf-input-select" title="">
    <option class="sf-level-0 sf-item-0" data-sf-count="0" data-sf-depth="0" value="">All Locations</option>
    <option class="sf-level-0 sf-item-177" data-sf-count="2" data-sf-depth="0" value="all" selected="selected">Location A</option>
    <option class="sf-level-0 sf-item-139" data-sf-count="24" data-sf-depth="0" value="vic" selected="selected">Location B</option>
</select>   

"auth": { "root": "libs/auth", "sourceRoot": "libs/auth/src", "projectType": "library", "prefix": "auth", "architect": { "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": [ "libs/auth/tsconfig.lib.json", "libs/auth/tsconfig.spec.json" ], "exclude": ["**/node_modules/**"] } }, "test": { "builder": "@nrwl/builders:jest", "options": { "jestConfig": "libs/auth/jest.config.js", "tsConfig": "libs/auth/tsconfig.spec.json", "setupFile": "libs/auth/src/test-setup.ts" } } }, "schematics": { "@nrwl/schematics:component": { "styleext": "scss" } } }, (库中)中包含test-setup.ts,它可以:

import 'jest-preset-angular';

在设置过程中。

那么,为什么IntelliJ不能像命令行一样正确地从angular.json中选择配置?我可以以某种方式在“编辑配置...”中解决此问题吗?

编辑:这是仓库:https://github.com/philly-vanilly/ng-reddit

0 个答案:

没有答案