Apollo Server GraphQL 테스트 구현

2022. 5. 18. 03:23서버 프로그래밍

 

https://www.daleseo.com/graphql-apollo-server-testing/

 

GraphQL 서버 테스트 방법 (Apollo Server Testing)

Engineering Blog by Dale Seo

www.daleseo.com

https://stackoverflow.com/questions/53935108/jest-did-not-exit-one-second-after-the-test-run-has-completed-using-express

 

Jest did not exit one second after the test run has completed using express

I'm using JEST for unit testing my express routes. While running the yarn test all my test case are getting passed, but I'm getting an error Jest did not exit one second after the test run has

stackoverflow.com

 

Redis Mock은 다음을 이용한다

https://www.npmjs.com/package/ioredis-mock

 

ioredis-mock

This library emulates ioredis by performing all operations in-memory.. Latest version: 8.2.0, last published: 9 days ago. Start using ioredis-mock in your project by running `npm i ioredis-mock`. There are 102 other projects in the npm registry using iored

www.npmjs.com

 

Mongo Mock은 다음을 이용한다

https://github.com/nodkz/mongodb-memory-server

 

GitHub - nodkz/mongodb-memory-server: Spinning up mongod in memory for fast tests. If you run tests in parallel this lib helps t

Spinning up mongod in memory for fast tests. If you run tests in parallel this lib helps to spin up dedicated mongodb servers for every test file in MacOS, *nix, Windows or CI environments (in most...

github.com

https://medium.com/weekly-webtips/express-js-testing-mocking-mongodb-46c3797a201

 

Express.js testing: mocking MongoDB

Use MongoDB Memory Server to test your API

medium.com

 

참고 : Apollo Server에서 Mocking

https://www.apollographql.com/docs/apollo-server/testing/mocking/

 

Mocking

Mock your GraphQL data based on a schema.

www.apollographql.com

 

참고 : GraphQL과 Mongoose를 이용한 테스팅

https://dev.to/jdelvx/how-i-m-currently-testing-my-graphql-resolvers-mongoose-operations-3lmf

 

How I'm currently testing my GraphQL Resolvers & Mongoose Operations

Photo by Jorn Eriksen on Unsplash. During the last couple of days, I've been doing some integration...

dev.to