Skip to content

Testing

iadmytro edited this page Aug 22, 2022 · 12 revisions

This codebase implements a CI process with end-to-end tests and continuous development deployment for both the mainnet and testnet.

System Requirements

About the tests

@cardano-graphql/api-cardano-db-hasura

The test suites are scoped to the GraphQL queries, as defined in the schema, and are required to be passing before new code is merged.

Run all tests once

git clone https://github.com/input-output-hk/cardano-graphql.git
cd cardano-graphql
yarn --offline && yarn build

start server

yarn preview:up or yarn preprod:up

run tests

yarn test

TDD

Wallaby.js

With your IDE configured

yarn dev

Starts the service dependencies

Integration test strategy

It's convenient to use the Apollo Integration test server during development, particularly with Wallaby, as it serves the GraphQL server without booting a HTTP server. The same tests are run on the CI server to provide end-to-end assurance, using an instance of ApolloClient and the API running in a Docker container.