简体   繁体   English

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

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

could you please tell me why why module in not found in angular ? 你能告诉我为什么为什么在angular中找不到模块吗? here is my code https://codesandbox.io/s/8k7vlvl5q2 这是我的代码https://codesandbox.io/s/8k7vlvl5q2

issue is on this line 问题在这条线上

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

TestBed is not found TestBed

在此处输入图片说明

There is no module named @angular/testing . 没有名为@angular/testing模块。

You have to import TestBed from @angular/core/testing . 您必须从@angular/core/testing导入TestBed

Change your import line to 将您的导入行更改为

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

Also make sure you install @angular/core correctly. 另外,请确保正确安装@angular/core

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

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