繁体   English   中英

为什么在角“ TestBed”中找不到模块?

[英]why module in not found in angular “TestBed”?

你能告诉我为什么为什么在angular中找不到模块吗? 这是我的代码https://codesandbox.io/s/8k7vlvl5q2

问题在这条线上

<<import { ComponentFixture, async, TestBed } from "@angular/testing";
>>

TestBed

在此处输入图片说明

没有名为@angular/testing模块。

您必须从@angular/core/testing导入TestBed

将您的导入行更改为

import { ComponentFixture, async, TestBed } from "@angular/core/testing";

另外,请确保正确安装@angular/core

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM