OverviewAdds the jest testing framework to a Loopback API. This module generates the base infrastructure to use jest with a Loopback API and optionally generates tests for the default API.
SpecificationName | Status | Description ---- | ------ | -----------
false| Set to true if you would like generated tests to be created for you for the API.
DependenciesThis module is dependent on
ExamplesThere are two examples for this package:
with-tests- This example is generated with
generateTests: trueso it has the infrastructure as well as generated tests.
without-tests- This example is generated with
generateTests: falseso it only has the base infrastructure and does not contain tests.
TestingModule tests are defined using a
test/scenarios.yamlfile. This file defines the set of example gigs that we generate as part of integration testing. To run all tests, run
yarn testat the root of this module.
Each scenario is generated in
test/scenario/<name>which you can then
cdinto and run the actual app. For a scenario called
default, this is done via:
cd test/scenario/default yarn install # Run tests. yarn test # Start the app. yarn start