This project aims to demonstrate a way to test Loopback applications in a scalable way.
It uses SuperTest to send the requests and test the responses.
Developed with:
- Node v4.4.3
- node-inspector@0.12.8
Each test suit has a test specific data set at each run.
The tests use the memory data source and boot the app with a dedicated data file.
Before a test suit is started, it calls TestUtils.start
with a name, app and data.
It then creates a file under tmp
and populates it with the data provided.
This ensures each test can be "clustered" and run separately without impacting each other.
All the tests are located under test/acceptance
.
./scripts/watch.sh ./test/acceptance/{{test-file-to-watch}}
./scripts/debug.sh ./test/acceptance/{{test-file-to-debug}}
Then in another tab:
./scripts/start-debugger.sh
- The code in
test/acceptance/data/
andtest/mock-factories
is kept bare simple for understandability. - Cannot debug and watch in the same time due to port conflict
- Successful POST requests should return 201