0.3.0 • Published 10 years ago

testarossa v0.3.0

Weekly downloads
62
License
-
Repository
github
Last release
10 years ago

Testarossa

NPM version

Testarossa, an extensible and truly async test framework for node

Description

System tests made easy, just add your properties to a testcase, post, get and validate your results. It comes with different formatters like jUnit, machine and colorful console output.

Example Usage

Checkout the example folder for a usage example or the simple example below.

module.exports = function(test) {
    test.add("test-setup", function(done) {
      this.dataToSend = {"name", "foo"};
      done();
    });
    test.get("/api", {status: 200});
    test.add("verify ok message", function(done) {
      var responseBody = JSON.parse(this.lastResponse.body);
      responseBody.should.have.property("message", "ok");
      done();
    });
    test.post("/api/hello", this.dataToSend, {status: 200});
    test.add("check the last response", function(done) {
      var responseBody = JSON.parse(this.lastResponse.body);
      responseBody.should.have.property("message", "hello foo");
      done();
    });
};

http helper

Using the http helper is quite forward for REST API testing. It takes a given path, optional body data and headers and a mandatory evaluate Object as shorthand validation (eg: {status: 200} will check against 200 reponse status code).

supported methods: get, head, post, put, delete, trace, options, connect, patch

$ test.[method](path,[body,][headers,]evaluateObject)

Changelog

v0.2.0 adding support for multiple fromatters see

$ node lib/cli.js --help
0.3.0

10 years ago

0.2.3

10 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.7

11 years ago

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.3

11 years ago

0.0.1

11 years ago