0.0.0 • Published 7 years ago
@testingrequired/restspec v0.0.0
Interact or test REST resources from the command line.
Use cases
- API testing (smoke, acceptance)
Installation
$ npm install @testingrequired/restspec@0.0.0
Usage
Rest Files
A rest file defines a single request with optional tests. They are plain javascript files that are intended to be edited as code. They should live with your project's tests.
Warning
The format for rest files is not stable and is subject to change with any new release.
Example
Rest files can be located anywhere.
// ./tests/rest/google.js
module.exports = {
name: "Google",
url: "http://google.com",
options: { method: "GET" },
tests: (response, assert) => [() => assert.equal(response.status, 200)]
};
Run
Calls url and prints response from rest file
$ restspec run ./tests/rest/google.js
Test
Calls url and runs tests from rest file
$ restspec test ./tests/rest/google.js
License
MIT - see LICENSE
0.0.0
7 years ago