使用 JEST 的 Apollo graphql 上的 Node js 代码覆盖率(部署的服务器测试)

发布于 2025-01-13 08:54:17 字数 276 浏览 4 评论 0原文

我有一个在 apollo 框架(nodeJs)上运行的 graphql 服务器,它在模拟和部署的服务器场景上编写了一些测试,即在模拟服务器和 AWS 部署的服务器上运行 graphql 查询/突变。它使用 JEST 来运行命令和测试。当我运行 --coverage 参数时,它会提供所运行测试的覆盖率报告,而不是执行其的代码的覆盖率。是否无法获取nodeJs中服务器到客户端场景的代码覆盖率

如果我可以使用 JEST 做任何事情或者我是否可以使用任何其他插件,请告诉我。

I have a graphql server running on apollo framework (nodeJs) which has few tests written on both mock and deployed server scenarios i.e., running graphql queries/mutations on both mock server and AWS deployed servers. It uses JEST to run the commands and test. When I run the --coverage argument it gives the coverage report of the tests that were run rather than the coverage of the code on which its executed. Is it not possible to get the code coverage in server to client scenario in nodeJs?

Please let me know if I can do anything with JEST or if I can use any other plugin.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文