简体   繁体   English

Angular 14 中的单元测试错误

[英]Unit testing errors in Angular 14

I created a brand new Angular project using the cli ng new ... and when I run npm test I get the below error in the browser:我使用 cli ng new ...创建了一个全新的 Angular 项目,当我运行npm test时,我在浏览器中收到以下错误:

在此处输入图像描述

and in the console I see this error:在控制台中我看到了这个错误:

在此处输入图像描述

I've not added anything extra;我没有添加任何额外的东西;

I tested with Node versions 14.17.1 and 16.16.0 (I am on macOS, and using nvm);我使用 Node 版本 14.17.1 和 16.16.0 进行了测试(我在 macOS 上,并且使用 nvm); I tried uninstalling both Node versons, deleted all nvm cache files, installed Node again, but still getting the error我尝试卸载两个 Node 版本,删除所有 nvm 缓存文件,再次安装 Node,但仍然出现错误

How can I debug or solve this issue?如何调试或解决此问题?

after much trial and error found out its due to chrome out of date;经过多次试验和错误发现它是由于铬过时; once I updated chrome to the latest version its started working.一旦我将 chrome 更新到最新版本,它就开始工作了。

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

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