Skip to content

Releases: ybonnefond/stubborn

v5.0.4

23 Jun 11:12
Compare
Choose a tag to compare

5.0.4 (2020-06-23)

Bug Fixes

v5.0.3

26 Jun 12:47
Compare
Choose a tag to compare

5.0.3 (2020-06-23)

Automatic Dependencies Upgrade

v5.0.2

23 Jun 08:19
Compare
Choose a tag to compare

5.0.2 (2020-06-23)

Automatic Dependencies Upgrade

  • bump chalk from 3.0.0 to 4.1.0 (c40f8a5)

v5.0.1

23 Jun 08:13
Compare
Choose a tag to compare

5.0.1 (2020-06-23)

Automatic Dependencies Upgrade

  • [security] bump acorn from 5.7.3 to 5.7.4 (248fdf1)

v5.0.0

23 Jun 05:57
Compare
Choose a tag to compare

BREAKING CHANGE
Null and undefined are not anymore converted to empty strings when applying a response template

For JSON responses body they will now follow the behavior of JSON.stringify

v3.0.1

03 Jan 14:27
Compare
Choose a tag to compare

Fixes

  • Fix rendering of object in diff log

v3.0.0

03 Jan 10:47
Compare
Choose a tag to compare

BREAKING CHANGES

Wildcarding

Null has been replaced by the constant WILDCARD

Before:

sb.get('/').setHeaders(null);

After:

import {WILDCARD} from 'stubborn-ws';

sb.get('/').setHeaders(WILDCARD);

Types changes

Some types has been renamed:
RequestDefinition => DefinitionValue
RequestBodyDefinition* => BodyDefinition*

Not Implemented event

The request is not directly passed to the event handler anymore
Before:

import {EVENTS} from 'stubborn-ws';
sb.on(EVENTS.NOT_IMPLEMENTED, (req) => console.log(req.path))

After:

import {EVENTS} from 'stubborn-ws';
sb.on(EVENTS.NOT_IMPLEMENTED, (dbg) => console.log(dbg.getInfo().path))

Features

Wildcarding

The WILDCARD constant is replacing null to wildcard path, headers, query parameters or body

import {WILDCARD} from 'stubborn-ws';

sb.get('/').setHeaders(WILDCARD);

Log differences between a request and a route

A function has been added to log differences between a route an any request returning a 501.

import {logDiffOn501} from 'stubborn-ws';

const route = sb.get('/').setHeaders(WILDCARD);

// Add this to figure out why the request is not matching
logDiffOn501(sb, route);

await request('/invalid-path');

// => diff output on stdout

Cleared event

A cleared event is emitted when sb.clear() is called

import { EVENTS } from 'stubborn-ws';

sb.on(EVENTS.CLEARED, ()=> console.log('Cleared!'));

sb.clear();

v2.2.1

03 Jan 10:50
Compare
Choose a tag to compare

Feat

Not implemented event

An event is emitted when a request does not match any routes

import {EVENTS} from 'stubborn-ws';

sb.on(EVENTS.NOT_IMPLEMENTED, (req) => console.log(req.path) );

v2.2.0

31 Dec 07:34
Compare
Choose a tag to compare

Features

  • Emit event on "Not Implemented" error with request info to help debugging

v2.1.0

18 Dec 14:29
Compare
Choose a tag to compare

Features

  • Directly Register Route instance