首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ng-模拟错误: TypeScript编译中缺少MockBuilder/test.深处.spec.ts

ng-模拟错误: TypeScript编译中缺少MockBuilder/test.深处.spec.ts
EN

Stack Overflow用户
提问于 2021-08-05 17:52:55
回答 1查看 165关注 0票数 1

我只是像以前的项目一样简单地使用ng模拟模块,但是今天我得到了以下错误:

代码语言:javascript
复制
Firefox 78.0 (Linux x86_64) ERROR
  An error was thrown in afterAll
  Error: Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
  Error: ....node_modules/ng-mocks/examples/MockBuilder/test.deep.spec.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
  The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format .
EN

回答 1

Stack Overflow用户

发布于 2022-03-06 20:07:14

在您的tsconfig.json中,您需要排除node_modules

代码语言:javascript
复制
{
  "exclude": ["node_modules"],
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68671386

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档