/testdeck

Object oriented testing

Primary LanguageTypeScriptApache License 2.0Apache-2.0

testdeck

The JavaScript OOP style tests!

// Use one of the mocha/jest/jasmine test runners:
import { suite, test } from "@testdeck/mocha";
import { suite, test } from "@testdeck/jest";
import { suite, test } from "@testdeck/jasmine";

import { expect } from 'chai';

// And turn your tests from functional:
describe("Hello", function() {
  it("world", function() {
    expect(false).to.be.true;
  });
});

// Into 100% OOP awesomeness:
@suite class Hello {
  @test world() {
    expect(false).to.be.true;
  }
}

// P.S. You can still mix and match!

Packages

This is the monorepo for the testdeck packages.

Build

Clone this repository using

git clone https://github.com/testdeck/testdeck.git

Then from inside the so created testdeck directory run

npm install 

This will install all required dependencies and will also bootstrap lerna.

The following npm scripts are available

  • npm run tslint -- runs tslint on all sources in all available packages
  • npm run tslint-fix -- runs tslint --fix on all sources in all available packages
  • npm test -- run all tests on all available packages

Resources