Vyt*_*nas 9 jestjs angular ts-jest
在我迁移到 Angular 13 和 Jest 28 后,我的测试停止工作。我收到这样的错误:
Test suite failed to run
TypeError: configSet.processWithEsbuild is not a function
> 1 | import { ChangeDetectionStrategy, Component, ChangeDetectorRef, OnChanges, SimpleChanges, OnInit, Input } from '@angular/core';
Run Code Online (Sandbox Code Playgroud)
i
进口标记红字
关于如何修复它有什么想法吗?
Mic*_*ich 16
在 Jest 配置中,transform
将值更改ts-jest
为jest-preset-angular
即之前:
transform: {
'^.+\\.(ts|js|html)$': 'ts-jest'
},
Run Code Online (Sandbox Code Playgroud)
后
transform: {
'^.+\\.(ts|js|html)$': 'jest-preset-angular'
},
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4269 次 |
最近记录: |