2.1.9 • Published 10 years ago

testly v2.1.9

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

Testly for NodeJS Build Status

Testly is an agile and polyglot testing framework. This is the NodeJS implementation.

NPM

Usage

Here is a basic example:

module.exports = function (suite) {
    var i = 0;

    suite.name("Basic");

    suite.init(function () {
        i++;
    });

    suite.define("Passing Test", function (test) {
        test.assert(i == 1);
    });

    suite.define("Failing Test", function (test) {
        test.shouldFail(function () {
            test.fail();
        });
    });

    suite.define("Assertion Test", function (test) {
        test.assert(5 == 5);
        test.assert("Hello" == "Hello");
        test.assert("Go" != "No");
        test.assert("LOL".toLowerCase() == "lol");
    });
};

Suite

A suite is a set of tests. Each file where tests are is a separate suite.

API

  • name: Gets/Sets the name of the suite
  • init: Pass a function to this function and it will be run before any tests are executed.
  • define: Defines a new test - args: String, Function

Test

The test object is passed to each test function as a utility belt :)

API

  • assert: Asserts that the input is true
  • shouldFail: Assertions or Errors are ignored in functions passed to it
  • fail: Fails the Test
  • exec: Executes a process - (uses shelljs's exec function)
  • shell: shelljs shorthand
  • log: String passed to this function will be recorded in the test reports

Assert

test.assert is a function that can be used like normal test assertions.

test.assert also adds the assert module's functions onto it, so it can be used like:

test.assert.equal(5, 5);

Bugs

Please file any bugs on the GitHub Issue Tracker.

2.1.9

10 years ago

2.1.8

10 years ago

2.1.7

10 years ago

2.1.6

10 years ago

2.1.5

10 years ago

2.1.4

10 years ago

2.1.3

10 years ago

2.1.2

10 years ago

2.1.1

10 years ago

2.0.10

10 years ago

2.0.9

10 years ago

2.0.8

10 years ago

2.0.7

10 years ago

2.0.6

10 years ago

2.0.5

10 years ago

2.0.4

10 years ago

2.0.3

10 years ago

2.0.0

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago