Tournesol
A Hapi-Glue-Lab-Code tool that could only be created by a crazy scientist.
$ npm install tournesol
Purpose
This package aims at making api tests using Hapi, Lab and Code easier. The idea is to focus on what the tests mean rather than how to perform them.
Usage
const Lcrud = Lcrud; var request = baseURL getPayload getHeaders;
const Tournesol = ;const Lcrud = Lcrud;const Lab = ;const lab = exportslab = Lab; const Server = ; // require the hapi server to test or build it within the test file. const definition = title: 'Title of the test with value of {pre.half1} + {input.itemId}' pre: assign: 'half1' name: 'half1 ( = 5)' { // no err ; } paramSets: titleComplement: 'hello mommy' input: itemId: 5 output: statusCode: 200 input: itemId: 10 output: statusCode: 404 { const request = '/items' null null ; return request; } ; Tournesol;
Doc
Please refer to:
- Lcrud: List + CRUD, to generates requests for tests.
- runTests: to run tests from a nice definition object.
About the name
Tournesol is the french name of the crazy professor in The Adventures of Tintin. You may know him by the name of Professor Calculus. This name was chosen since this package turns Lab into the home of a mad scientist.