track-spec

0.0.4 • Public • Published

TrackSpec

A test framework of track.

Build Status

Installation

npm

npm install track-spec

Usage

This framework is extension of ospec.

Running test

package.json

"scripts"{
  "test": "ospec"
}
$ npm test

Example

TrackSpec has the methods of ospec and methods of like rspec. (describe, context, it, expect)

const t    = require('track-spec');
const Hoge = require('./hoge');
 
t.describe('Hoge', () => {
  t.describe('.hoge', () => {
    const subject = ( () => Hoge.hoge(type));
    let type = null;
 
    t.context('When type is `upper`', () => {
      t.beforeEach(() => {
        type = `upper`;
      });
 
      t.it('Return HOGE', () => {
        t.expect(subject()).equals('HOGE');
      });
    });
 
    t.context('When type is `lower`', () => {
      t.beforeEach(() => {
        type = `lower`;
      });
 
      t.it('Return hoge', () => {
        t.expect(subject()).equals('hoge');
      });
    });
  });
});

CONTRIBUTING

test

$ npm test

linter

$ npm run linter

Readme

Keywords

none

Package Sidebar

Install

npm i track-spec

Weekly Downloads

0

Version

0.0.4

License

ISC

Unpacked Size

2.66 kB

Total Files

7

Last publish

Collaborators

  • alfa-jpn