Abstract Winston Transport
A set of mocha
-based tests for ensuring that a given Transport (written for winston >= 3
) is compatible with the expected APIs.
Inspired by https://github.com/maxogden/abstract-blob-store
Usage
test/your-transport.test.js
name: 'YourTransport'Transport:;
Sample usage from winston/test/transports/console.test.js
name: 'Console'Transport: winstontransportsConsole;
Passing in custom options to your TransportStream
If your custom TransportStream
requires more options on construction than a default TransportStream
they can be provided via the construct
option:
test/your-transport.test.js
name: 'YourTransport'Transport:construct:anyRequired: 'value-for-transport'anythingReally: 'depends-on-what-you-need'//// "construct" can also be a function that returns// options if that's something you need//{returnwillBe: 'called-before'every: 'test';};
query
and stream
test suites
Turning on additional There are additional suites for query
and stream
interfaces expected to be exposed on a winston
Transport (i.e. a TransportStream
). You can enable these by setting the options to true
:
test/your-transport.test.js
name: 'YourTransport'Transport:query: truestream: true;