rokot-test
TypeScript icon, indicating that this package has built-in type declarations

0.3.2 • Public • Published

rokot-test

Rokot - Rocketmakers TypeScript NodeJs Platform

Introduction

A typescript testing library for nodejs applications

Created to bring together the suite of testing tools we use and make writing test scripts as simple as possible.

Contributing

Installation

After pulling the source

npm i

Getting Started

Installation

Install via npm

npm i rokot-test --save-dev

Setup

Modify your package.json to invoke mocha within the test script (ensure you compile the typescript before running mocha):

  • WebPack
{
  "scripts": {
    "test": "webpack --progress && mocha"
  }
}
  • Typescript
{
  "scripts": {
    "test": "tsc -p source && mocha"
  }
}

Create a test folder within the root of your project and create a mocha.opts file containing the path to your compiled js test file(s):

dist/tests/*-test.js

Example

Create a <test>.ts file:

import {expect} from "rokot-test";
 
describe("Every Application should have a Test suite", () => {
  it("should cover all functional areas of your code base", () => {
    var testers = {};
    var developers = testers;
 
    expect(developers).to.be.eq(testers);
  });
})

The full set of imports are:

import {expect,sinon,supertest,chai} from "rokot-test";

Now, become a tester!!!

Running

To execute your tests (via the test script you specified earlier within package.json):

npm test

Consumed Libraries

mocha

test framework engine (including teamcity reporter)

chai

assertions library (with additional plugins)

sinon

Test spies, stubs and mocks

supertest

HTTP assertions (for express route testing)

Package Sidebar

Install

npm i rokot-test

Weekly Downloads

15

Version

0.3.2

License

MIT

Last publish

Collaborators

  • sheamurphy1919
  • rocketsoper
  • joerocketmakers
  • rocketmakers-admin
  • adamrocketmakers
  • david.haylock