Object | Function
{}
需要先通过 pnpm run new
启用 单元测试 功能。
对应 Jest 的配置,当为 Object
类型时,可以配置 Jest 所支持的所有底层配置 。
export default defineConfig({
tools: {
jest: {
testTimeout: 10000,
},
},
});
值为 Function
类型时,默认配置作为第一个参数传入,需要返回新的 Jest 配置对象。
export default defineConfig({
tools: {
jest: options => {
return {
...options,
testTimeout: 10000,
};
},
},
});