Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

abstract-winston-transport

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstract-winston-transport

An abstract test suite for winston inspired by abstract-blob-store

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
177
decreased by-16.9%
Maintainers
1
Weekly downloads
 
Created
Source

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

require('abstract-winston-transport')({
  name: 'YourTransport',
  Transport: require('../path/to/your/transport')
});

Sample usage from winston/test/transports/console.test.js

require('abstract-winston-transport')({
  name: 'Console',
  Transport: winston.transports.Console
});

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

require('abstract-winston-transport')({
  name: 'YourTransport',
  Transport: require('../path/to/your/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
  //
  construct: function () {
    return {
      willBe: 'called-before'
      every: 'test'
    };
  }
});

Turning on additional query and stream test suites

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

require('abstract-winston-transport')({
  name: 'YourTransport',
  Transport: require('../path/to/your/transport'),
  query: true,
  stream: true
});
Author: Charlie Robbins
LICENSE: MIT

Keywords

FAQs

Package last updated on 02 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc