apollographql / apollographql/fullstack-tutorial

Error object in Integration test is different compared to error in playground

未关闭
#154 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
1.2k
派生
808
PR 合并指标
30 天内没有已合并 PR

描述

I wanted to test the error scenario for my query/mutation but I’m unable to do so. I've reproduced the issue in this [PR here at this line](https://github.com/apollographql/fullstack-tutorial/pull/153/files#diff-e38243b449b86e768973cba723ec7c8fR103).

Basically the problem is that when one of our datasource methods triggers an error then the `errorFromResponse` method is called and then the error is returned and we see that error in our playground but when you try to test it and mock the error in your test the error you get from query/mutation method from `apollo-server-testing` are both different.

#153

贡献指南

这个仓库没有索引到贡献指南

调研方向

从 PR #153 中的集成测试用例开始,具体查看第 103 行的链接 diff,并通过 errorFromResponse 以及 apollo-server-testing 中的 query/mutation 调用追踪 datasource 错误。将该结果与 playground 错误进行比较,并运行受影响的集成测试。当测试能够以与 playground 相同的错误形态或消息复现 datasource 故障时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
graphql, node.js, typescript
领域
api, testing
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。