Experimental test suite for Shields.
These tests use IcedFrisby, Joi (which is bundled with IcedFrisby),
Nock, and a plugin that adds an .intercept() method, for concise nock
support within IcedFrisby.
Create a shields symlink in the root of the project.
Then, to run the tests:
npm run test:vendor-take-2
Depends on:
Also depends on these two PRs in IcedFrisby:
These tests use Nock Back.
By default, this test uses recorded http calls, allow additional http calls,
and doesn’t record anything. It’s useful for developing new tests.
SHIELDS_DIR=/path/to/shields npm run test:vendor
There is a bug it seems, that prevents this from working correctly when
some fixtures are already recorded for the same hostname. To work around that,
delete fixtures.json and try again.
When you have written your tests, record the http calls:
NOCK_BACK_MODE=record SHIELDS_DIR=/path/to/shields npm run test:vendor
Then you can run them in “lockdown” mode, which will use the recorded calls
and raise errors for any unexpected calls.
NOCK_BACK_MODE=lockdown SHIELDS_DIR=/path/to/shields npm run test:vendor
Pro tip: To run a single
itordescribe, change toit.onlyor
describe.only.
SHIELDS_DIR=/path/to/shields npm run test:vendor:coverage
opn coverage/lcov-report/index.html
SHIELDS_DIR=/path/to/shields npm run test:basic
Note: This test will hit all the external services.
Start a shields server on port 1111:
SHIELDS_DIR/path/to/shields npm run start
Pro tip: If you’re developing regularly, set
SHIELDS_DIRin your shell
startup files.
This project is in the public domain.