Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arojunior/tests-with-nodejs-graphql
WIP - Integration tests with NodeJs and GraphQL
https://github.com/arojunior/tests-with-nodejs-graphql
graphql hacktoberfest nodejs
Last synced: 3 months ago
JSON representation
WIP - Integration tests with NodeJs and GraphQL
- Host: GitHub
- URL: https://github.com/arojunior/tests-with-nodejs-graphql
- Owner: arojunior
- Created: 2019-01-21T12:19:06.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T13:59:21.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T23:01:54.004Z (9 months ago)
- Topics: graphql, hacktoberfest, nodejs
- Language: JavaScript
- Homepage:
- Size: 330 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Integration Tests with NodeJs and GraphQL
### Goal
It is using Docker, so to run it in the CI environment, I need to make sure that the database is up and with all migrations applied before run tests.
**How can I do it?**
The [arojunior/flyway:5.2.4](https://github.com/arojunior/flyway) image help to handle the migrations. It is using the "wait-for-it" script to wait for MySQL container before execute the migrations.
The other helper is the `config/setupTests.js` script. It is used to get the database up and wait for the migrations being applied before start the tests.
### What you can find here
- Boilerplate for NodeJs + GraphQL applications;
- Good example for types and schema organization;
- ESLint already configured.### Problem that I want to solve for tests
- Reliable test, I mean, not just for schema;
- Easy to setup;
- Easy to understand;### Runnning the tests
**Locally**
```sh
docker-compose up -d
```After all the containers get up, you can run
```sh
yarn && yarn test
```**On CI**
```sh
yarn && yarn test-ci
```
The `test-ci` script will execute the `setupTests.js` before running the tests, which is prepared to start all the containers and wait for the migrations to be completed