# bdd-with-opts

> A more flexible bdd interface for Mocha

Latest version **1.1.1** (published 2016-10-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install bdd-with-opts
pnpm add bdd-with-opts
yarn add bdd-with-opts
bun add bdd-with-opts
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2016-10-02 |
| First published | 2014-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sebv |
| Maintainers | sebv |
| Keywords | mocha, bdd, interface |

## Links

- npm: https://www.npmjs.com/package/bdd-with-opts
- Repository: https://github.com/sebv/mocha-bdd-with-opts
- Issues: https://github.com/sebv/mocha-bdd-with-opts/issues
- npm.io page: https://npm.io/package/bdd-with-opts

## Dependencies (1)

- [vargs](https://npm.io/package/vargs.md) 0.1.0

## Recent versions

- 1.1.1 (latest) — 2016-10-02
- 1.1.0 — 2016-10-02
- 1.0.0 — 2014-10-10
- 0.0.4 — 2014-06-22
- 0.0.3 — 2014-06-22
- 0.0.2 — 2014-06-22
- 0.0.1 — 2014-06-22

## README

# mocha-bdd-with-opts

Alternate BDD for Mocha with options in the parameter list. For the moment
it only supports the pending option, used to skip tests.

[![NPM version](http://img.shields.io/npm/v/bdd-with-opts.svg)](https://npmjs.org/package/bdd-with-opts) 
[![Downloads](http://img.shields.io/npm/dm/bdd-with-opts.svg)](https://npmjs.org/package/bdd-with-opts)
[![Dependency Status](https://david-dm.org/sebv/mocha-bdd-with-opts.svg)](https://david-dm.org/sebv/mocha-bdd-with-opts)
[![devDependency Status](https://david-dm.org/sebv/mocha-bdd-with-opts/dev-status.svg)](https://david-dm.org/sebv/mocha-bdd-with-opts#info=devDependencies)

## Usage

Basics:

```js

"use strict";
var assert = require('assert');

/* global describe, it */
describe('bdd-with-opts', function(){
  var testCount = 0;

  it('should be skiped', {pending: true}, function(){
    testCount ++;
    assert(false);
  });

  it('should not be skiped', function(){
    testCount ++;
    assert(true);
  });

  it('should have run 1 test' ,function(){
    assert(testCount === 1);
  });

});

```

With a skip function:

```js
"use strict";
/* global describe, it */

var assert = require('assert');

var ENV = {
    BROWSER: 'firefox'
};

function skipIfBrowserIs(browserToSkip) {
    var ret = {
        pending: ENV.BROWSER === browserToSkip
    };
    console.log('ret -->', ret);
    return ret;
}

describe('bdd-with-opts', function(){
  var testCount = 0; 

  it('should be skiped', skipIfBrowserIs('firefox'), function(){
    testCount ++;
    assert(false);
  });

  it('should not be skiped', skipIfBrowserIs('chrome') ,function(){
    testCount ++;
    assert(true);
  });

  it('should have run 1 test' ,function(){
    assert(testCount === 1);
  });

});

```

---
_Source: https://npm.io/package/bdd-with-opts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
