Questions & Answers API Service
This project is setup with Typescript with the tsconfig.json file generated with npx tsc --init
.
Create a .env file modeled after example.env
Install and start development environment:
npm i
npm dev
Transpile Typescript and run production server:
npm run build
npm run start
Prior to testing create a .env.test file. This should mirror the .env file but the DATABASE_NAME should be appended with _TEST.
Add environment variable to .env.test
RESET_TEST_DATABASE=true
to assure test database is reset as expected.
Run tests with
npm run test
Tests will run on the provided test database. Each time running the test will tear down the prior test database and reconstruct it.
Local performance tests written with k6. To run performance tests start the production server and run performance test script
npm run test:perf