hume utils test
Some helpers shared among the tests.
Install
npm i @hume/utils-test
Use
const utilsTest = require('@hume/utils-test');
console.log('Version');
console.log(utilsTst.version);
API
version
The actual version of the library.
-
version
(string) - Version number.
shoot
A wrapper for snap-shot-it'.
async throwsAsync(block, errRegex) -> null
Am async version of assert.throws.
-
block
(function) - Piece of code (returning a promise) to be checked. -
errRegex
(object) - Regular expresion to confirm the expected error.
request
A wrapper for supertest with some additions (see next points).
async request.login(creds, opts) -> res
To login in Loopback using supertest in an easy way.
-
creds
(object) - User credentials:-
email
(string) - Email of the user to create. -
password
(string) - Password of the user to create.
-
-
opts
(object) - Optional params:-
path
(string) - Endpoint path. (default: '/api/users/login')
-
-
res
(object) - The response with.-
id
(string) - The new token.
-