Node JavaScript runtime environment.
# clone repo
$ git clone https://github.com/InnerWorks-me/qa-testing-task.git
# install dependencies
$ npm install
# run integration tests
$ npm run test:integrationEnsure the tests all pass, if not, let us know before starting.
The src folder contains the main source code, which is a simple CRUD application editing an in-memory data source. The files included are task.module, task.controller, task.service, and main.ts. For more information on the structure of a NestJS application see the docs on controllers, providers, and modules.
The test folder contains an integration test to check the application functionality, it currently only tests the endpoint to create an item, the task will be to test the other functionality (see below). The files included are task.intergation-test-cases, task.integration.spec, and jest-integration.json.
The task will be based around the task.integration.spec files and the task.integration-test-cases files. The task.integration.spec file has code to launch the application, a function to call the /items POST endpoint, and two tests for success and failure when calling that endpoint.
There are four other endpoints to be tested:
/itemsGET/items/{id}GET/items/:idPUT/items/:idDELETE
All endpoints can be seen in the task.controller file in src.
Your task is:
- Add 8 new test cases to the
task.integration-test-casesfile, a success and failure test case for each of the endpoints. - Add 4 new functions to
task.integration.specto call each of the endpoints, using thetestCreateEndpointScenariofunction as an example. - Add 8 new tests to
task.integration.specusing each of the 8 test cases created intask.integration-test-cases.
All test cases should successfully run with
$ npm run test:integration