Specs consistent of three basic sections:
Create a new spec under the specs/
folder:
1linkmeta:
2link name: Star Wars suite
3linkconfiguration:
4link scheme: https
5link host: swapi.dev
6link base_path: /api
7linkspecs:
8link - name: Fetch info about Luke Skywalker
9link request:
10link path: /people/1/
11link method: get
12link accept: application/json
13link response:
14link status_code: 200
15link headers:
16link - name: content-type
17link value: !!js/regexp application/json
18link json_data:
19link - path: $.name
20link value: Luke Skywalker
Run the spec from the terminal:
1link$./node_modules/.bin/rest-ez
Test Suite path/pattern/directory is not specified, Looking for suites in specs directory
Found suites:
- specs/star-wars-service.yml
Launcher will run suites: specs/star-wars-service.yml
✓ Fetch info about Luke Skywalker (649ms)
Done: specs/star-wars-service.yml (Passed)
0 skipped, 0 failed, 1 passing (1 tests)
0 skipped, 0 failed, 1 passing (1 suites)
Duration: 667ms