This package has been deprecated

Author message:

Project discontinued

@hume/utils-test

0.8.0 • Public • Published

hume utils test

Some helpers shared among the tests.

Install

Install Node.js v8 and then:

npm i @hume/utils-test

Use

📝 You can visit the complete example in this tests.

const utilsTest = require('@hume/utils-test');

console.log('Version');
console.log(utilsTst.version);

API

👀 Full specification.

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.

Package Sidebar

Install

npm i @hume/utils-test

Weekly Downloads

7

Version

0.8.0

License

Apache-2.0

Unpacked Size

3.99 kB

Total Files

4

Last publish

Collaborators

  • abdonrd
  • ismaelrozas
  • jesusprubio