1.1.3 • Published 8 years ago

swagger-tester v1.1.3

Weekly downloads
5
License
MIT
Repository
github
Last release
8 years ago

swagger-tester

A framework for testing your swagger 2.0 specifications. Easily can be used as an additional step in Continious Integration. This module is a command line tool. It exits with code 1 if any of the tests fails. And code 0 if all fine.

Installation

npm install -g swagger-tester

Usage

node swagger-tester --specs=./swagger.json --tests=./examples/tests

You will need to provide command line arguments:

  • Required Swagger specification file with --specs option. Valid options are:
    • any http or https remote file: https://somebucket.s3.amazonaws.com/somePublicSpecs.json
    • any absolute path: /opt/projects/swagger.json
    • any relative path: ../../specs.json
  • Required Path to file or folder with tests with --tests <path> option:
    • ../tests/
    • tests/myapi.js
  • Optional Server base url including api version (if any) with --server <your server url>. This, if specified, will override corresponding values in specification.
    • https://api.server.com/v2

Tests

For tests examples take a look into examples folder.

Notes

At the moment only NO SECURITY and JWT SECURITY supported. So you will have to provide api token if you are using JWT. Add --token=<JWT TOKEN HERE> option when launching app to specify token.