【发布时间】:2019-10-31 00:50:38
【问题描述】:
好吧,我正在用 typescript 编写一些 NPM 模块,但我没有使用 Webpack 来编译脚本。
我应该如何配置 jest 以使用 typescript 文件正常运行?
// test.spec.ts
import {calc} from './index'
test('shoud...', () => {
expect(calc()).toBeDefined()
})
// index.ts
import {calc} from './index'
const calc = (a, b) => {
return a + b
}
我收到了这个错误:
testMatch: /__tests__//*.js?(x),**/?(*.)+(spec|test).js?(x) - 0 个匹配项 testPathIgnorePatterns: /node_modules/ - 9 个匹配项
【问题讨论】:
标签: typescript jestjs