egg-mock 似乎不能检测到 eggjs 项目的 typescript 配置?
Jeff-Tian opened this issue · comments
在此输入你需要反馈的 Bug 具体信息(Bug in Detail):
- 我的 eggjs 项目基于 typescript
- 项目本身可以正常运行(yarn dev 后可以正常打开 http://localhost:7001)
- 确认在配置里正确配置了 config.keys
- 但是在使用 egg-mock 跑测试时,报错了。
- 报的错误是: Please add
config.keys
in config/config.default.js - 期待它能够从 config.default.ts 而不是 config.default.js 正确读取 keys
可复现问题的仓库地址(Reproduction Repo)
https://github.com/jeff-tian/alpha
Node 版本号:
v15.4.0
Eggjs 版本号:
3.3.0
相关插件名称与版本号(PlugIn and Name):
"egg-mock": "3.16.0",
操作平台与版本号(Platform and Version):
MacBook Pro Apple M1 Pro
原因找到了,这是我在 WebStorm 里使用 mocha 直接跑测试导致的。通过从命令行运行 egg-bin test
不会有这个问题。不过,该怎么在 WebStorm 里运行 typescript eggjs 测试呢?期待分享……
webstorm 终端里面执行 npm run test 就可以了。
Webstorm 终端似乎和普通终端没区别。主要是想和 webstorm 的 UI 结合起来。
获取 Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
发件人: fengmk2 ***@***.***>
发送时间: Thursday, March 2, 2023 9:43:38 AM
收件人: eggjs/egg ***@***.***>
抄送: Jeff Tian ***@***.***>; State change ***@***.***>
主题: Re: [eggjs/egg] egg-mock 似乎不能检测到 eggjs 项目的 typescript 配置? (Issue #5151)
webstorm 终端里面执行 npm run test 就可以了。
―
Reply to this email directly, view it on GitHub<https://ind01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feggjs%2Fegg%2Fissues%2F5151%23issuecomment-1451149550&data=05%7C01%7C%7C82e803ef3c5342665c0408db1abf8c09%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638133182249160955%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=mrSy6s8j0C6zi3bjxBA7VrllfxSIEJeNiIuK%2BjKz6Og%3D&reserved=0>, or unsubscribe<https://ind01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAZWHDEBTZXAJ7VYQK7N7WLWZ73MVANCNFSM6AAAAAAVLRPPZM&data=05%7C01%7C%7C82e803ef3c5342665c0408db1abf8c09%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638133182249160955%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=aD%2Fk2UYCLTtx%2BVQc0ihEMd1dc7cwGea1KEzcA%2BTSVeg%3D&reserved=0>.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>