You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在StackBlitz中搭建Angular 16与Jasmine的测试环境

Angular 16 + Jasmine 配置问题(StackBlitz环境)

问题详情

我需要在StackBlitz中复现Angular+Jasmine相关问题,但找到的可用示例均基于旧版Angular。将示例升级到Angular 16后,先后遇到以下错误:

1. Zone.js 入口解析错误

修改前在polyfills.ts中出现如下错误:

Error in polyfills.ts
The entrypoint for 'zone.js' could not successfully be resolved.
The file '/turbo_modules/zone.js@0.14.0/dist/zone' does not exist.

2. Jasmine-core 相关错误

按照npm文档将导入语句改为import 'zone.js';后,出现jasmine-core入口无法解析的错误;在WebStorm中尝试导入jasmine-core/lib/jasmine-core.js时,触发TS7016类型声明缺失错误,手动添加src/jasmine.d.ts文件后问题仍未解决。

当前目标:基于Angular 16实现原旧版示例的功能。


内容的提问来源于stack exchange,提问作者Jan Brell

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.08 23:48:26