首页 > 解决方案 > 使用 svelte-kit build 后未定义 jest

问题描述

我有一个测试文件,src/routes/index.test.js我注意到测试结束了,.svelte-kit/output/server/app.js所以看起来生产版本正在尝试运行我的测试。

错误

Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-node
> jest is not defined
ReferenceError: jest is not defined

潜在的解决方案

我的猜测是我需要以某种方式排除测试文件

解决方法

将测试移出src

标签: jestjssveltekit

解决方案


推荐阅读