The intent of this development is to build a product that will support digital procurement needs for the BC Government including services such as, but not limited to, Sprint With Us, Code With Us, The Procurement Concierge.
This adds an integration test harness for the API that leverages jest and an ephemeral PostgreSQL database.
To run the current integration tests, run yarn integration-tests:run. The setup for the environment and launching of the ephemeral database is handled by a bash script scrips/run-integration-tests.sh. This script will launch the dockerized test database, run migrations, export any required environment variables and then launch the integration tests using jest.
Since the database is cleared in between tests, a separate schema digmkt-test is used as the default for the ephemeral database. This is to eliminate any risk of the tests being run against a non-test database, and clearing out data unintentionally.
The full suite of integrations tests has not yet been added, but this should be useful for supporting the development of TWU as well as any refactors/improvements to existing functionality (i.e. email notifications).
Notes:
The integration tests are not configured to run in GitHub actions on pull requests, but this can easily be set up if desired.
In order to prevent a dependency on KeyCloak when running the tests, mock sessions and signed session IDs are used.
This adds an integration test harness for the API that leverages
jest
and an ephemeral PostgreSQL database.To run the current integration tests, run
yarn integration-tests:run
. The setup for the environment and launching of the ephemeral database is handled by a bash scriptscrips/run-integration-tests.sh
. This script will launch the dockerized test database, run migrations, export any required environment variables and then launch the integration tests usingjest
.Since the database is cleared in between tests, a separate schema
digmkt-test
is used as the default for the ephemeral database. This is to eliminate any risk of the tests being run against a non-test database, and clearing out data unintentionally.The full suite of integrations tests has not yet been added, but this should be useful for supporting the development of TWU as well as any refactors/improvements to existing functionality (i.e. email notifications).
Notes: