Socket
Book a DemoInstallSign in
Socket

it-optional

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

it-optional

Mocha add-on method it.optional() which marks a test as pending if it would fail

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
15
-48.28%
Maintainers
1
Weekly downloads
 
Created
Source

npm version Build Status Dependency Status

it-optional

Mocha add-on method it.optional() which marks a test as pending if it would fail

Overview

it-optional was created with adapter/plugin test suites in mind where a common set of tests is used to test different modules. If one or more tests is not mandatory for all it can be marked as optional using it.optional(title, fn). If the test passes then its marked as "passing" if the test fails then it's marked as "pending". This way optional functionality can be testes without breaking the whole suite.

Instalation

npm i it-optional -S

Usage

it.optional = require('it-optional');

it.optional('should do xyz', function(done){
  done();
});
// ✓ should do xyz

it.optional('should do xyz eventually', function(done){
  done(new Error('oops'));
});
// - PENDING: should do xyz async eventually

it.optional('should do abc eventually', function(done){
  Assert.equal(1, 2);
});
// - PENDING: should do abc async eventually

// custom messages
it.optional('should do xyz eventually', 'xyz not implemented yet', function(done){
  done(new Error('oops'));
});
// - xyz not implemented yet

Keywords

mocha

FAQs

Package last updated on 31 May 2015

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.