【问题标题】:How can I test a GraphQL server using Mongoose with Jest如何使用 Mongoose 和 Jest 测试 GraphQL 服务器
【发布时间】:2017-02-24 01:14:40
【问题描述】:

我想针对我使用 jest 快照功能连接到 mongoose 数据库的 graphql 实现来测试查询

我想遵循这种方法:https://github.com/nodkz/graphql-compose-examples/blob/master/examples/user/tests/queriesFromIndex.js

使用 Jest 快照来测试我的查询结果。

这种方法的一个缺点是我需要使用相同的虚拟数据预先填充我的 mongo 数据库以始终获得相同的结果

测试 graphql 服务器的方法有哪些?包括突变和订阅

【问题讨论】:

    标签: testing mongoose snapshot jestjs graphql-js


    【解决方案1】:

    【讨论】:

      猜你喜欢
      • 2020-07-16
      • 2019-08-07
      • 2018-11-03
      • 1970-01-01
      • 1970-01-01
      • 2019-08-29
      • 2019-10-03
      • 2018-08-07
      • 2019-04-26
      相关资源
      最近更新 更多