2017 © Pedro Peláez
 

project http-endpoint-tester

Test application for http(s) endpoints written in node.js

image

psybizz/http-endpoint-tester

Test application for http(s) endpoints written in node.js

  • Wednesday, December 16, 2015
  • by merlijntishauser
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,292 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

http-endpoint-tester

A HTTP endpoint tester using node.js, inspired by the node-test-tutorial of David Beath and the talk of Danny Dinneen at the 2014 edition of the Endpoint conference., (*1)

The tool is written to be used in a CI pipeline with jenkins, to test endpoints of rest(ful) API's. That's why it depends on environment variables, this makes it easy to use the tool in a CI pipeline., (*2)

Usage

initialise environment

npm install, (*3)

This will install/update all the required modules for running the tests, (*4)

Also a composer wrapper is provided, implemented to keep our own jenkins as stupid as possible ;), (*5)

Run tests

ENDPOINT_PATHS=<path/to/paths/file.json> ENDPOINT_HOST=<host>:<port> SITE_URI=<FQDN> ./node_modules/.bin/mocha --ui tdd, (*6)

Adding paths to test

Select the project in resources Open paths.json and add the following stanza:, (*7)

json [ { "path": "/api/info", "method": "GET", "headers": { "header1": "value1", "header2": "value2" }, "statusCode": [200, 302], "public": 1, "secure": 0, "requireFQDN": 0, "timeout": 500 }, { // another stanza } ], (*8)

path: path to test
method: GET,POST, PUT or PATCH
statuscode: [statuscode(s)]
public: should endpoint be available in production
secure: use http or https (needs to be implemented) timeout: timeout in milliseconds
requireFQDN: mark a test as optional or required when an site uri has been specified. ( optional parameter ), (*9)

public and secure are not implemented yet., (*10)

NOTE on site_uri: this will be set as host header in the request object as demanded by the HTTP1.1 standard, but the request/request implementation will use this value as proxy. So when the tested host is not identical to the site_uri, you are strongly advised to specify followRedirects to false., (*11)

Resources

Todo

  • implement https support

The Versions

16/12 2015

dev-master

9999999-dev https://github.com/psybizz/http-endpoint-tester

Test application for http(s) endpoints written in node.js

  Sources   Download

MIT

http tests node.js

16/12 2015

v1.0.3

1.0.3.0 https://github.com/psybizz/http-endpoint-tester

Test application for http(s) endpoints written in node.js

  Sources   Download

MIT

http tests node.js

23/10 2015

v0.1.2

0.1.2.0 https://github.com/psybizz/http-endpoint-tester

Test application for http(s) endpoints written in node.js

  Sources   Download

MIT

http tests node.js