jestjs - 使用 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
解决方案
推荐阅读
- scala - 组成一系列返回未来的函数
- javascript - Firebase 存储规则错误:意外标识符;从文档中获取的功能
- cordova - 如何在科尔多瓦中找到 config.xml?
- casting - 无法将字符串从标准输入解析为浮点 - Rust
- jquery - 为页面上的每个表运行 Jquery 函数
- linux - shell 将多少个参数传递给命令:
- typescript - 为什么我可以分配一个空对象类型 {[key: string]: number}
- c++ - 在类中创建对象
- python - 如何遍历二维列表的一部分
- elasticsearch - 如何将持久数据结构保存到弹性搜索中