gpt4 book ai didi

angular - TypeError : configSet. processWithEsbuild 不是函数

转载 作者:行者123 更新时间:2023-12-05 09:27:22 29 4
gpt4 key购买 nike

在我迁移到 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';

标记红色i进口信

关于如何修复它有任何想法吗?

最佳答案

在 Jest 配置中,在 transform 部分将值 ts-jest 更改为 jest-preset-angular

即之前:

  transform: {
'^.+\\.(ts|js|html)$': 'ts-jest'
},

之后

  transform: {
'^.+\\.(ts|js|html)$': 'jest-preset-angular'
},

关于angular - TypeError : configSet. processWithEsbuild 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72517003/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com