Code Monkey home page Code Monkey logo

gulp-chutzpah's Introduction

gulp-chutzpah Build Status

A gulp plugin to run javascript tests using Chutzpah test runner

Installation

npm install gulp-chutzpah

Usage

...with the test files

var gulp = require("gulp"),
    chutzpah = require("gulp-chutzpah");

var opts = {
    executable: "/path/to/chutzpah.console.exe"
};

gulp.task("test", function(){
    gulp.src("./tests/*.js")
    .pipe(chutzpah(opts));
});

...with chutzpah settings file

var gulp = require("gulp"),
    chutzpah = require("gulp-chutzpah");

var opts = {
    executable: "/path/to/chutzpah.console.exe",
    isSettingsFile: true
};

gulp.task("test", function(){
    gulp.src("/path/to/chutzpah-settings.json")
    .pipe(chutzpah(opts));
});

...with exec options (optional)

var opts = {
    executable: "/path/to/chutzpah.console.exe"
    // other options
};

var execOptions = {
    encoding: 'utf8',
    timeout: 0,
    maxBuffer: 200 * 1024
    // other exec options
}

gulp.task("test", function(){
    gulp.src("/my/test/files.extention")
    .pipe(chutzpah(opts, execOptions));
});

Options

The options object must have a property named executable, which is the location of your chutzpah console executable file. Usually, it is chutzpah.console.exe.

You can optionally supply any of the chutzpah command line options, except path.

Here are the options again with their default values:

  • executable : Required. "/path/to/chutzpah.console.exe".
  • isSettingsFile : Conditionally required. Must set to true when using chutzpah settings files to specify test files and/or other settings. Detail about the json settings file can be found here. Important: when this value is set to true, all other settings are ignored (except of course, executable). Default is false.
  • nologo : Do not show the copyright message. Default is false.
  • silent : Do not output running test count. Default is false.
  • teamcity : Forces TeamCity mode (normally auto-detected). Default is false.
  • wait : Wait for input after completion. Default is false.
  • failOnError : Return a non-zero exit code if any script errors or timeouts occurs. Default is false.
  • debug : Print debugging information and tracing to console. Default is false.
  • trace : Logs tracing information to chutzpah.log. Default is false.
  • openInBrowser : Launch the tests in a browser. Default is false. Set true to launch in default browser. You can also set it to your desired browser name like "IE", "Firefox" or "Chrome".
  • parallelism : Max degree of parallelism for Chutzpah. Default is false. Set it any number you want. You can also set it to true, which will be treated as number of CPUs + 1. Note that, if it set to more than 1, the test output may be a bit jumbled.
  • vsoutput : Print output in a format that the VS error list recognizes. Default is false.
  • coverage : Enable coverage collection. Default is false.
  • showFailureReport : Show a failure report after the test run. Usefull if you have a large number of tests. Default is false.
  • settingsFileEnvironment : Sets the environment properties for a chutzpah.json settings file. Default is "". Specify more than one to add multiple environments. Example value: "settingsFilePath;prop1=val1;prop2=val2".
  • junit : output results to JUnit-style XML file. Default is "". Set a file path to generate the file.
  • lcov : outputs results as LCOV data for further processing. Default is "". Set a file path to generate the file.
  • trx : output results to Visual Studio Trx file. Default is "". Set a file path to generate the file.
  • nunit2 : output results to NUnit-style XML file. Default is "". Set a file path to generate the file.
  • coveragehtml : Outputs default Chutzpah coverage HTML. Default is "". Set a file path to generate the file.

Exec Options

This is optional second parameter to chutzpah(). Default options can be found here.

gulp-chutzpah's People

Contributors

gavinkirchner avatar irega avatar mrdesjardins avatar zpbappi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

gulp-chutzpah's Issues

maxBuffer exceeded

@zpbappi We have another error now:

[09:45:25] Error: stdout maxBuffer exceeded
at Socket.onChildStdout (child_process.js:328:14)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:246:13)
at Socket.Readable.push (_stream_readable.js:208:10)
at Pipe.onread (net.js:594:20)

You can solve it with this exec command option:

var executeOptions = {
maxBuffer: 10000 * 1024
};
exec(command, executeOptions, function (err, stdout, stderr) {
console.log(stdout);
console.error(stderr);
callback(err);
});

I think that the "10000" value must be configurable through the plugin options (200 by default), what do you think? If its ok, I will send a new pull request.

Where is chutzpah.runner.exe etc located

I found where the Chutzpah extension is installed, but I cannot seem to locate where the runner executable is found. Can you point me in the right direction there? Thanks!

Travis CI build is failing

Tests in Travis CI are failing. But, they all run successfully in the local environment. Probably, the environment has changed in travis. Need to investigate the diff between travis and local environment (where the tests are passing).

Command line too long

Hi! We are using this plugin in our deploy process, but we have a large number of tests and when we execute them with the normal parameters, the console shows the "command line too long" error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.