grunt-gabarito

0.0.6 • Public • Published

grunt-gabarito Build Status

Run gabarito test runner within grunt

TL;DR

Install dev dependencies.

npm install gabarito --save-dev
npm install grunt-gabarito --save-dev

Configure within Gruntfile.js

grunt.initConfig({
    gabarito: {
        src: ["test.js"]
    }
});
 
grunt.loadNpmTasks("grunt-gabarito");

Write test.

// test.js
 
var gabarito = require("gabarito");
var assert = gabarito.assert;
 
gabarito.add("test").
clause("should pass", function () {
    assert.isTrue(true);
}).
 
clause("should fail", function () {
    assert.isTrue(false);
});

Run.

grunt gabarito

Options

src

Type: String|Array

Test files. These files will be passed to the selected gabarito environment(s).

options.environments

Type: Array default: ["node"]

Your gabarito environments. Gabarito will issue the test files for each of the selected environments. This plugin comes bundled with "node" and "phantom" environments. For aditional configurations to be passed to the environment, the object format may be used.

E.g.:

grunt.initConfig({
    gabarito: {
        src: "test.js",
        environments: [
            "phantom",
            {
                type: "node",
                stack: "true"
            }
        ]
    }
});

options.reporters

Type: Array default: ["console"]

Gabarito reporters. Gabarito will tell the reporters what is going on with the tests themselves. This plugin comes bundled with "console" and "junit" reporters. For aditional configurations to be passed to the reporter, the object format may be used.

E.g.:

grunt.initConfig({
    gabarito: {
        src: "test.js",
        reporters: [
            "console",
            {
                type: "junit",
                file: "junit-results.xml",
                name: "Project X"
            }
        ]
    }
});

options.config

Type: String

JSON file to be used as configuration.

Readme

Keywords

Package Sidebar

Install

npm i grunt-gabarito

Weekly Downloads

0

Version

0.0.6

License

none

Last publish

Collaborators

  • pablo-cabrera