Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

grunt-saucelabs

axemclion5.5kMIT9.0.1

Grunt task running tests using Sauce Labs. Supports QUnit, Jasmine, Mocha and YUI tests

gruntplugin, grunt, saucelabs, test, jasmine, mocha, qunit, yui

readme

grunt-saucelabs

Build Status Selenium Test Status

Selenium Test Status

Dependency Status devDependency Status

A Grunt task for running QUnit, Jasmine, Mocha or any framework using Sauce Labs' Cloudified Browsers.

Grunt is a task-based command line build tool for JavaScript projects, based on nodejs. QUnit is a powerful, easy-to-use JavaScript unit test suite used by the jQuery, jQuery UI and jQuery Mobile projects and is capable of testing any generic JavaScript code, including itself! Jasmine is a behavior-driven development framework for testing JavaScript code. Mocha is a JavaScript test framework for running serial asynchronous tests. Sauce Labs offers browser environments on the cloud for testing code.

About the tool

The grunt-contrib-qunit task runs QUnit based test suites on PhantomJS. The saucelabs-qunit task is very similar but runs the test suites on the cloudified browser environment provided by Sauce Labs. This ensures that subject of the test runs across different browser environment. The task also uses Sauce Connect to establish a tunnel between Sauce Labs browsers and the machine running Grunt to load local pages. This is typically useful for testing pages on localhost that are not publicly accessible on the internet. The saucelabs-jasmine runs Jasmine tests in the Sauce Labs browser. The saucelabs-jasmine task requires jasmine-1.3.0. There is also a saucelabs-mocha task that lets you run your Mocha tests on Sauce Labs cloudified browser environment.

Usage

This task is available as a node package and can be installed as npm install grunt-saucelabs. It can also be included as a devDependency in package.json in your node project.

To use the task in grunt.js, load the npmTask.

grunt.loadNpmTasks('grunt-saucelabs');

In the grunt.initConfig, add the configuration that looks like the following

var request = require('request');
...
'saucelabs-qunit': {
  all: {
    options: {
      username: 'saucelabs-user-name', // if not provided it'll default to ENV SAUCE_USERNAME (if applicable)
      key: 'saucelabs-key', // if not provided it'll default to ENV SAUCE_ACCESS_KEY (if applicable)
      urls: ['www.example.com/qunitTests', 'www.example.com/mochaTests'],
      build: process.env.CI_BUILD_NUMBER,
      testname: 'Sauce Unit Test for example.com',
      browsers: [{
        browserName: 'firefox',
        version: '19',
        platform: 'XP'
      }]
      // optionally, he `browsers` param can be a flattened array:
      // [["XP", "firefox", 19], ["XP", "chrome", 31]]
    }
  }
}

The configuration of saucelabs-jasmine, saucelabs-mocha and saucelabs-custom are exactly the same. Note the options object inside a grunt target. This was introduced in grunt-saucelabs-* version 4.0.0 to be compatible with grunt@0.4.0

Full list of parameters which can be added to a saucelabs-* task:

  • username : The Sauce Labs username that will be used to connect to the servers. If not provided, uses the value of SAUCE_USERNAME environment variable. Optional
  • key : The Sauce Labs secret key. Since this is a secret, this should not be checked into the source code and may be available as an environment variable. Grunt can access this using process.env.saucekey. Will also default to SAUCE_ACCESS_KEY environment variable. Optional
  • urls: An array or URLs that will be loaded in the browsers, one after another. Since SauceConnect is used, these URLs can also be localhost URLs that are available using the server task from grunt. Required
  • build: The build number for this test. Optional
  • testname: The name of this test, displayed on the Sauce Labs dashboard. Optional
  • tags: An array of strings, to be added as tags to the test on Sauce Labs. Optional
  • tunneled: Defaults to true; Won't launch a Sauce Connect tunnel if set to false. Optional
  • tunnelArgs: Array of optional arguments to be passed to the Sauce Connect tunnel. example: ['--debug', '--direct-domains', 'google.com']. See here for further documentation.
  • sauceConfig: Map of extra parameters to be passed to sauce labs. example: {'video-upload-on-pass': false, 'idle-timeout': 60}. See here for further documentation.
  • pollInterval: Number of milliseconds between each retry to see if a test is completed or not (default: 2000). Optional
  • statusCheckAttempts: Number of times to attempt to see if a test is completed or not (default: 90). Effectively, your tests have statusCheckAttempts * pollInterval seconds to complete (Thus, 180s by default). Set to -1 to try forever.
  • throttled: Maximum number of unit test pages which will be sent to Sauce Labs concurrently. Exceeding your Sauce Labs' allowed concurrency can lead to test failures if you have a lot of unit test pages. Optional
  • max-duration: Maximum duration of a test, this is actually a Selenium Capability. Sauce Labs defaults to 180 seconds for js unit tests. Optional
  • browsers: An array of objects representing the various browsers on which this test should run. Optional
  • onTestComplete: A callback that is called every time a unit test for a page is complete. Runs per page, per browser configuration. Receives two arguments (result, callback). result is the javascript object exposed to sauce labs as the results of the test. callback must be called, node-style (having arguments err, result where result is a true/false boolean which sets the test result reported to the command line). See example below Optional
  • maxRetries: Specifies how many times the timed out tests should be retried (default: 0). Optional
  • public: The job visibility level. Defaults to 'team'. Optional

A typical test task running from Grunt could look like grunt.registerTask('test', ['server', 'qunit', 'saucelabs-qunit']); This starts a server and then runs the QUnit tests first on PhantomJS and then using the Sauce Labs browsers.

Exposing Test Results to the Sauce Labs API

Since this project uses the Sauce Labs js unit test API, the servers at Sauce Labs need a way to get the results of your test. Follow the instructions below to assure that the results of your tests are delivered properly.

Test result details with Jasmine

You can make Job Details pages more informative on Sauce by providing more data with each test. You will get info about each test run inside your suite directly on Sauce pages.

Jasmine detailed results

You can do that by using Jasmine JS Reporter that will let saucelabs-jasmine task provide in-depth data about each test as a JSON object.

All you need to do is to include the new jasmine-jsreporter reporter to the page running Jasmine tests by adding new script in header:

<script src="path/to/jasmine-jsreporter.js" type="text/javascript"></script>

and telling Jasmine to use it:

jasmineEnv.addReporter(new jasmine.JSReporter());
`

Test result details with QUnit

Add the following to your QUnit test specification

var log = [];
var testName;

QUnit.done(function (test_results) {
  var tests = [];
  for(var i = 0, len = log.length; i < len; i++) {
    var details = log[i];
    tests.push({
      name: details.name,
      result: details.result,
      expected: details.expected,
      actual: details.actual,
      source: details.source
    });
  }
  test_results.tests = tests;

  window.global_test_results = test_results;
});
QUnit.testStart(function(testDetails){
  QUnit.log(function(details){
    if (!details.result) {
      details.name = testDetails.name;
      log.push(details);
    }
  });
});

Test result details with mocha

Add the following to the mocha test page html. Make sure you remove any calls to mocha.checkLeaks() or add mochaResults to the list of globals.

<script>
  onload = function(){
    //mocha.checkLeaks();
    //mocha.globals(['foo']);
    var runner = mocha.run();

    var failedTests = [];
    runner.on('end', function(){
      window.mochaResults = runner.stats;
      window.mochaResults.reports = failedTests;
    });

    runner.on('fail', logFailure);

    function logFailure(test, err){

      var flattenTitles = function(test){
        var titles = [];
        while (test.parent.title){
          titles.push(test.parent.title);
          test = test.parent;
        }
        return titles.reverse();
      };

      failedTests.push({name: test.title, result: false, message: err.message, stack: err.stack, titles: flattenTitles(test) });
    };
  };
</script>

OnTestComplete callback

An optional parameter to the grunt task is OnTestComplete, a callback which is called at the end of every test, before results are logged to the console. You can use this callback to intercept results from SauceLabs and re-report the results (or use the information for your own purposes)

Receives two arguments (result, callback). result is the javascript object exposed to sauce labs as the results of the test. callback must be called, node-style (having arguments err, result where result is a true/false boolean which sets the test result reported to the command line)

When running the tests for this project, we need to test the case where a test fails on Sauce. In this case, we want to record a test Failure as a Success for us.

'saucelabs-qunit': {
  all: {
    options: {
      username: 'saucelabs-user-name', // if not provided it'll default to ENV SAUCE_USERNAME (if applicable)
      key: 'saucelabs-key', // if not provided it'll default to ENV SAUCE_ACCESS_KEY (if applicable)
      urls: ['www.example.com/qunitTests', 'www.example.com/mochaTests'],
      build: process.env.CI_BUILD_NUMBER,
      testname: 'Sauce Unit Test for example.com',
      browsers: [{
        browserName: 'firefox',
        version: '19',
        platform: 'XP'
      }],
      onTestComplete: function(result, callback) {
        // Called after a unit test is done, per page, per browser
        // 'result' param is the object returned by the test framework's reporter
        // 'callback' is a Node.js style callback function. You must invoke it after you
        // finish your work.
        // Pass a non-null value as the callback's first parameter if you want to throw an
        // exception. If your function is synchronous you can also throw exceptions
        // directly.
        // Passing true or false as the callback's second parameter passes or fails the
        // test. Passing undefined does not alter the test result. Please note that this
        // only affects the grunt task's result. You have to explicitly update the Sauce
        // Labs job's status via its REST API, if you want so.

        // The example below negates the result, and also updates the Sauce Labs job's status
        var user = process.env.SAUCE_USERNAME;
        var pass = process.env.SAUCE_ACCESS_KEY;
        request.put({
            url: ['https://saucelabs.com/rest/v1', user, 'jobs', result.job_id].join('/'),
            auth: { user: user, pass: pass },
            json: { passed: !result.passed }
        }, function (error, response, body) {
          if (error) {
            callback(error);
          } else if (response.statusCode !== 200) {
            callback(new Error('Unexpected response status'));
          } else {
            callback(null, !result.passed);
          }
        });
      }
    }
  }
}

Examples

Some projects that use this task are as follows. You can take a look at their GruntFile.js for sample code

If you have a project that uses this plugin, please add it to this list and send a pull request.

Integration with a CI system

Grunt tasks are usually run alongside a continuous integration system. For example, when using Travis, adding the following lines in the package.json ensures that the task is installed with npm install is run. Registering Sauce Labs in test task using grunt.registerTask('test', ['server', 'saucelabs-qunit']); ensures that the CI environment runs the tests using npm test. To secure the Sauce Key, the CI environment can be configured to provide the key as an environment variable instead of specifying it file. CI Environments like Travis provide ways to add secure variables in the initial configuration. The IndexedDBShim is a project that uses this plugin in a CI environment. Look at the .travis.yml and the grunt.js for usage example.

Changelog

9.0.0

  • removed support for YUI Test (Yahoo deprecated the framework a year ago). It will still work but we are not planning support for it moving forward
  • update Sauce Connect to version 4.3.16
  • updated dependencies (grunt not updated because we are waiting on grunt-sauce-tunnel)

8.6.3

  • updated some dependencies
  • support for Grunt 1.0.0
  • fix some broken tests

8.6.2

  • updated Sauce Connect to v4.3.12

8.6.1

  • added public parameter, so tests can be made Public on Sauce Labs
  • when retrying a test, browser name and test url are output to stdout
  • default build number added when running tests locally
  • update Sauce Connect to v4.3.7\
  • updated npm dependencies
  • fixed a bug where YUI or Qunit tests were detected as Passed, when they actually failed

8.6.0

  • check job completion a maximum number of times
  • added a config setting, statusCheckAttempts which defaults to 90
  • updated to Sauce Connect v4.3.6
  • update dependencies

8.5.0

  • fix ECONNRESET errors caused by network connectivity issues
  • better error logging

8.4.1

  • updated sauce-tunnel to v2.1.1 (and therefore Sauce Connect to v4.3.5)

8.4.0

  • polling a job for its status now retries
  • add maxPollRetries parameter, which specifies the number of status-requests to make before giving up on a job

8.3.3

  • improvements to README
  • add a 'tags' parameter to the config, to allow setting tags on tests
  • optionally, you can set "name" and "tags" onto the "browser" object and they'll be applied to the corresponding job

8.3.2

  • fixed a bug where DELETE commands which errored on the Sauce side caused test execution to halt

8.3.0

  • add testPageUrl to result object. Indicates the url which was the target of the test.

8.2.2

  • browsers param can optionally be an array identical to the one used by the Sauce API. ex: ["XP", "firefox", "19"]

8.2.1

  • update dependencies

8.2.0

  • upgrade to sauce-tunnel 2.1 (SC 3.4)

8.1.1

  • better detection and handling or errors which happen on Sauce Labs

8.1.0

  • added retry logic, thanks again to @gvas, now you can use maxRetries parameter to automatically retry tests which fail

8.0.3

  • fixed bug, sauce job urls displayed in log properly again

8.0.2

  • fixed bug, testname option not working

8.0.1

  • Major refactor, thanks to all the work done by @gvas
  • async onTestComplete callback fixed. Now the callback is passed two args: result, callback. callback is a node style callback (err, result);
  • /examples directory added, while the actual tests and Gruntfile are now more complicated (and useful)

7.0.0

  • throttled parameter now represents the max number of jobs sent concurrently. Previously was throttled * browsers.length

6.0.0

  • default testInterval changed to 2000ms
  • added max-duration, sauceConfig, and sauceTunnel params

5.1.3

  • update to sauce-tunnel 2.0.6, which uses Sauce Connect 4.2
  • queued job throttling added

5.1.2

  • use sauce-tunnel-sc3-1 to protect against heartbleed bug

5.1.1

  • Qunit reporting code made ecma3 compatible
  • Qunit reporting code doesn't clober the .done() callback
  • Updated dependencies

5.1.0

  • Added custom framework
  • Updated the test reporting on example pages to provide details when tests fail

changelog

1.17.0 / 2014-01-09

  • add: able to require globals (describe, it, etc.) through mocha (#1077)
  • fix: abort previous run on --watch change (#1100)
  • fix: reset context for each --watch triggered run (#1099)
  • fix: error when cli can't resolve path or pattern (#799)
  • fix: canonicalize objects before stringifying and diffing them (#1079)
  • fix: make CR call behave like carriage return for non tty (#1087)

1.16.2 / 2013-12-23

  • fix: couple issues with ie 8 (#1082, #1081)
  • fix: issue running the xunit reporter in browsers (#1068)
  • fix: issue with firefox < 3.5 (#725)

1.16.1 / 2013-12-19

  • fix: recompiled for missed changes from the last release

1.16.0 / 2013-12-19

  • add: Runnable.globals(arr) for per test global whitelist (#1046)
  • add: mocha.throwError(err) for assertion libs to call (#985)
  • remove: --watch's spinner (#806)
  • fix: duplicate test output for multi-line specs in spec reporter (#1006)
  • fix: gracefully exit on SIGINT (#1063)
  • fix expose the specified ui only in the browser (#984)
  • fix: ensure process exit code is preserved when using --no-exit (#1059)
  • fix: return true from window.onerror handler (#868)
  • fix: xunit reporter to use process.stdout.write (#1068)
  • fix: utils.clean(str) indentation (#761)
  • fix: xunit reporter returning test duration a NaN (#1039)

1.15.1 / 2013-12-03

  • fix: recompiled for missed changes from the last release

1.15.0 / 2013-12-02

  • add: --no-exit to prevent process.exit() (#1018)
  • fix: using inline diffs (#1044)
  • fix: show pending test details in xunit reporter (#1051)
  • fix: faster global leak detection (#1024)
  • fix: yui compression (#1035)
  • fix: wrapping long lines in test results (#1030, #1031)
  • fix: handle errors in hooks (#1043)

1.14.0 / 2013-11-02

  • add: unified diff (#862)
  • add: set MOCHA_COLORS env var to use colors (#965)
  • add: able to override tests links in html reporters (#776)
  • remove: teamcity reporter (#954)
  • update: commander dependency to 2.0.0 (#1010)
  • fix: mocha --ui will try to require the ui if not built in, as --reporter does (#1022)
  • fix: send cursor commands only if isatty (#184, #1003)
  • fix: include assertion message in base reporter (#993, #991)
  • fix: consistent return of it, it.only, and describe, describe.only (#840)

1.13.0 / 2013-09-15

  • add: sort test files with --sort (#813)
  • update: diff depedency to 1.0.7
  • update: glob dependency to 3.2.3 (#927)
  • fix: diffs show whitespace differences (#976)
  • fix: improve global leaks (#783)
  • fix: firefox window.getInterface leak
  • fix: accessing iframe via window[iframeIndex] leak
  • fix: faster global leak checking
  • fix: reporter pending css selector (#970)

1.12.1 / 2013-08-29

  • remove test.js from .gitignore
  • update included version of ms.js

1.12.0 / 2013-07-01

  • add: prevent diffs for differing types. Closes #900
  • add Mocha.process hack for phantomjs
  • fix: use compilers with requires
  • fix regexps in diffs. Closes #890
  • fix xunit NaN on failure. Closes #894
  • fix: strip tab indentation in clean utility method
  • fix: textmate bundle installation

1.11.0 / 2013-06-12

  • add --prof support
  • add --harmony support
  • add --harmony-generators support
  • add "Uncaught " prefix to uncaught exceptions
  • add web workers support
  • add suite.skip()
  • change to output # of pending / passing even on failures. Closes #872
  • fix: prevent hooks from being called if we are bailing
  • fix this.timeout(0)

1.10.0 / 2013-05-21

  • add add better globbing support for windows via glob module
  • add support to pass through flags such as --debug-brk=1234. Closes #852
  • add test.only, test.skip to qunit interface
  • change to always use word-based diffs for now. Closes #733
  • change mocha init tests.html to index.html
  • fix process global leak in the browser
  • fix: use resolve() instead of join() for --require
  • fix: filterLeaks() condition to not consider indices in global object as leaks
  • fix: restrict mocha.css styling to #mocha id
  • fix: save timer references to avoid Sinon interfering in the browser build.

1.9.0 / 2013-04-03

  • add improved setImmediate implementation
  • replace --ignore-leaks with --check-leaks
  • change default of ignoreLeaks to true. Closes #791
  • remove scrolling for HTML reporter
  • fix retina support
  • fix tmbundle, restrict to js scope

1.8.2 / 2013-03-11

  • add setImmediate support for 0.10.x
  • fix mocha -w spinner on windows

1.8.1 / 2013-01-09

  • fix .bail() arity check causing it to default to true

1.8.0 / 2013-01-08

  • add Mocha() options bail support
  • add Mocha#bail() method
  • add instanceof check back for inheriting from Error
  • add component.json
  • add diff.js to browser build
  • update growl
  • fix TAP reporter failures comment :D

1.7.4 / 2012-12-06

  • add total number of passes and failures to TAP
  • remove .bind() calls. re #680
  • fix indexOf. Closes #680

1.7.3 / 2012-11-30

  • fix uncaught error support for the browser
  • revert uncaught "fix" which breaks node

1.7.2 / 2012-11-28

  • fix uncaught errors to expose the original error message

1.7.0 / 2012-11-07

  • add --async-only support to prevent false positives for missing done()
  • add sorting by filename in code coverage
  • add HTML 5 doctype to browser template.
  • add play button to html reporter to rerun a single test
  • add this.timeout(ms) as Suite#timeout(ms). Closes #599
  • update growl dependency to 1.6.x
  • fix encoding of test-case ?grep. Closes #637
  • fix unicode chars on windows
  • fix dom globals in Opera/IE. Closes #243
  • fix markdown reporter a tags
  • fix this.timeout("5s") support

1.6.0 / 2012-10-02

  • add object diffs when err.showDiff is present
  • add hiding of empty suites when pass/failures are toggled
  • add faster .length checks to checkGlobals() before performing the filter

1.5.0 / 2012-09-21

  • add ms() to .slow() and .timeout()
  • add Mocha#checkLeaks() to re-enable global leak checks
  • add this.slow() option [aheckmann]
  • add tab, CR, LF to error diffs for now
  • add faster .checkGlobals() solution [guille]
  • remove fn.call() from reduce util
  • remove fn.call() from filter util
  • fix forEach. Closes #582
  • fix relaying of signals [TooTallNate]
  • fix TAP reporter grep number

1.4.2 / 2012-09-01

  • add support to multiple Mocha#globals() calls, and strings
  • add mocha.reporter() constructor support [jfirebaugh]
  • add mocha.timeout()
  • move query-string parser to utils.js
  • move highlight code to utils.js
  • fix third-party reporter support [exogen]
  • fix client-side API to match node-side [jfirebaugh]
  • fix mocha in iframe [joliss]

1.4.1 / 2012-08-28

  • add missing Markdown export
  • fix Mocha#grep(), escape regexp strings
  • fix reference error when devicePixelRatio is not defined. Closes #549

1.4.0 / 2012-08-22

  • add mkdir -p to mocha init. Closes #539
  • add .only(). Closes #524
  • add .skip(). Closes #524
  • change str.trim() to use utils.trim(). Closes #533
  • fix HTML progress indicator retina display
  • fix url-encoding of click-to-grep HTML functionality

1.3.2 / 2012-08-01

  • fix exports double-execution regression. Closes #531

1.3.1 / 2012-08-01

  • add passes/failures toggling to HTML reporter
  • add pending state to xit() and xdescribe() [Brian Moore]
  • add the @charset "UTF-8"; to fix #522 with FireFox. [Jonathan Creamer]
  • add border-bottom to #stats links
  • add check for runnable in Runner#uncaught(). Closes #494
  • add 0.4 and 0.6 back to travis.yml
  • add -E, --growl-errors to growl on failures only
  • add prefixes to debug() names. Closes #497
  • add Mocha#invert() to js api
  • change dot reporter to use sexy unicode dots
  • fix error when clicking pending test in HTML reporter
  • fix make tm

1.3.0 / 2012-07-05

  • add window scrolling to HTML reporter
  • add v8 --trace-* option support
  • add support for custom reports via --reporter MODULE
  • add --invert switch to invert --grep matches
  • fix export of Nyan reporter. Closes #495
  • fix escaping of HTML suite titles. Closes #486
  • fix done() called multiple times with an error test
  • change --grep - regexp escape the input

1.2.2 / 2012-06-28

  • Added 0.8.0 support

1.2.1 / 2012-06-25

  • Added this.test.error(err) support to after each hooks. Closes #287
  • Added: export top-level suite on global mocha object (mocha.suite). Closes #448
  • Fixed js code block format error in markdown reporter
  • Fixed deprecation warning when using path.existsSync
  • Fixed --globals with wildcard
  • Fixed chars in nyan when his head moves back
  • Remove --growl from test/mocha.opts. Closes #289

1.2.0 / 2012-06-17

  • Added nyan reporter [Atsuya Takagi]
  • Added mocha init <path> to copy client files
  • Added "specify" synonym for "it" [domenic]
  • Added global leak wildcard support [nathanbowser]
  • Fixed runner emitter leak. closes #432
  • Fixed omission of .js extension. Closes #454

1.1.0 / 2012-05-30

  • Added: check each mocha(1) arg for directories to walk
  • Added --recursive [tricknotes]
  • Added context for BDD [hokaccha]
  • Added styling for new clickable titles
  • Added clickable suite titles to HTML reporter
  • Added warning when strings are thrown as errors
  • Changed: green arrows again in HTML reporter styling
  • Changed ul/li elements instead of divs for better copy-and-pasting [joliss]
  • Fixed issue #325 - add better grep support to js api
  • Fixed: save timer references to avoid Sinon interfering.

1.0.3 / 2012-04-30

  • Fixed string diff newlines
  • Fixed: removed mocha.css target. Closes #401

1.0.2 / 2012-04-25

  • Added HTML reporter duration. Closes #47
  • Fixed: one postMessage event listener [exogen]
  • Fixed: allow --globals to be used multiple times. Closes #100 [brendannee]
  • Fixed #158: removes jquery include from browser tests
  • Fixed grep. Closes #372 [brendannee]
  • Fixed #166 - When grepping don't display the empty suites
  • Removed test/browser/style.css. Closes #385

1.0.1 / 2012-04-04

  • Fixed .timeout() in hooks
  • Fixed: allow callback for mocha.run() in client version
  • Fixed browser hook error display. Closes #361

1.0.0 / 2012-03-24

  • Added js API. Closes #265
  • Added: initial run of tests with --watch. Closes #345
  • Added: mark location as a global on the CS. Closes #311
  • Added markdown reporter (github flavour)
  • Added: scrolling menu to coverage.html. Closes #335
  • Added source line to html report for Safari [Tyson Tate]
  • Added "min" reporter, useful for --watch [Jakub Nešetřil]
  • Added support for arbitrary compilers via . Closes #338 [Ian Young]
  • Added Teamcity export to lib/reporters/index [Michael Riley]
  • Fixed chopping of first char in error reporting. Closes #334 [reported by topfunky]
  • Fixed terrible FF / Opera stack traces

0.14.1 / 2012-03-06

  • Added lib-cov to .npmignore
  • Added reporter to mocha.run([reporter]) as argument
  • Added some margin-top to the HTML reporter
  • Removed jQuery dependency
  • Fixed --watch: purge require cache. Closes #266

0.14.0 / 2012-03-01

  • Added string diff support for terminal reporters

0.13.0 / 2012-02-23

  • Added preliminary test coverage support. Closes #5
  • Added HTMLCov reporter
  • Added JSONCov reporter [kunklejr]
  • Added xdescribe() and xit() to the BDD interface. Closes #263 (docs * Changed: make json reporter output pretty json
  • Fixed node-inspector support, swapped --debug for debug to match node. needed) Closes #247

0.12.1 / 2012-02-14

  • Added npm docs mocha support [TooTallNate]
  • Added a Context object used for hook and test-case this. Closes #253
  • Fixed Suite#clone() .ctx reference. Closes #262

0.12.0 / 2012-02-02

  • Added .coffee --watch support. Closes #242
  • Added support to --require files relative to the CWD. Closes #241
  • Added quick n dirty syntax highlighting. Closes #248
  • Changed: made HTML progress indicator smaller
  • Fixed xunit errors attribute [dhendo]

0.10.2 / 2012-01-21

  • Fixed suite count in reporter stats. Closes #222
  • Fixed done() after timeout error reporting [Phil Sung]
  • Changed the 0-based errors to 1

0.10.1 / 2012-01-17

  • Added support for node 0.7.x
  • Fixed absolute path support. Closes #215 [kompiro]
  • Fixed --no-colors option [Jussi Virtanen]
  • Fixed Arial CSS typo in the correct file

0.10.0 / 2012-01-13

  • Added -b, --bail to exit on first exception [guillermo]
  • Added support for -gc / --expose-gc [TooTallNate]
  • Added qunit-inspired interface
  • Added MIT LICENSE. Closes #194
  • Added: --watch all .js in the CWD. Closes #139
  • Fixed self.test reference in runner. Closes #189
  • Fixed double reporting of uncaught exceptions after timeout. Closes #195

0.8.2 / 2012-01-05

  • Added test-case context support. Closes #113
  • Fixed exit status. Closes #187
  • Update commander. Closes #190

0.8.1 / 2011-12-30

  • Fixed reporting of uncaught exceptions. Closes #183
  • Fixed error message defaulting [indutny]
  • Changed mocha(1) from bash to node for windows [Nathan Rajlich]

0.8.0 / 2011-12-28

  • Added XUnit reporter [FeeFighters/visionmedia]
  • Added say(1) notification support [Maciej Małecki]
  • Changed: fail when done() is invoked with a non-Error. Closes #171
  • Fixed err.stack, defaulting to message. Closes #180
  • Fixed: make tm mkdir -p the dest. Closes #137
  • Fixed mocha(1) --help bin name
  • Fixed -d for --debug support

0.7.1 / 2011-12-22

  • Removed mocha-debug(1), use mocha --debug
  • Fixed CWD relative requires
  • Fixed growl issue on windows [Raynos]
  • Fixed: platform specific line endings [TooTallNate]
  • Fixed: escape strings in HTML reporter. Closes #164

0.7.0 / 2011-12-18

  • Added support for IE{7,8} [guille]
  • Changed: better browser nextTick implementation [guille]

0.6.0 / 2011-12-18

  • Added setZeroTimeout timeout for browser (nicer stack traces). Closes #153
  • Added "view source" on hover for HTML reporter to make it obvious
  • Changed: replace custom growl with growl lib
  • Fixed duplicate reporting for HTML reporter. Closes #154
  • Fixed silent hook errors in the HTML reporter. Closes #150

0.5.0 / 2011-12-14

  • Added: push node_modules directory onto module.paths for relative require Closes #93
  • Added teamcity reporter [blindsey]
  • Fixed: recover from uncaught exceptions for tests. Closes #94
  • Fixed: only emit "test end" for uncaught within test, not hook

0.4.0 / 2011-12-14

  • Added support for test-specific timeouts via this.timeout(0). Closes #134
  • Added guillermo's client-side EventEmitter. Closes #132
  • Added progress indicator to the HTML reporter
  • Fixed slow browser tests. Closes #135
  • Fixed "suite" color for light terminals
  • Fixed require() leak spotted by [guillermo]

0.3.6 / 2011-12-09

  • Removed suite merging (for now)

0.3.5 / 2011-12-08

  • Added support for window.onerror [guillermo]
  • Fixed: clear timeout on uncaught exceptions. Closes #131 [guillermo]
  • Added mocha.css to PHONY list.
  • Added mocha.js to PHONY list.

0.3.4 / 2011-12-08

  • Added: allow done() to be called with non-Error
  • Added: return Runner from mocha.run(). Closes #126
  • Fixed: run afterEach even on failures. Closes #125
  • Fixed clobbering of current runnable. Closes #121

0.3.3 / 2011-12-08

  • Fixed hook timeouts. Closes #120
  • Fixed uncaught exceptions in hooks

0.3.2 / 2011-12-05

  • Fixed weird reporting when err.message is not present

0.3.1 / 2011-12-04

  • Fixed hook event emitter leak. Closes #117
  • Fixed: export Spec constructor. Closes #116

0.3.0 / 2011-12-04

  • Added -w, --watch. Closes #72
  • Added --ignore-leaks to ignore global leak checking
  • Added browser ?grep=pattern support
  • Added --globals <names> to specify accepted globals. Closes #99
  • Fixed mocha-debug(1) on some systems. Closes #232
  • Fixed growl total, use runner.total

0.2.0 / 2011-11-30

  • Added --globals <names> to specify accepted globals. Closes #99
  • Fixed funky highlighting of messages. Closes #97
  • Fixed mocha-debug(1). Closes #232
  • Fixed growl total, use runner.total

0.1.0 / 2011-11-29

  • Added suiteSetup and suiteTeardown to TDD interface [David Henderson]
  • Added growl icons. Closes #84
  • Fixed coffee-script support

0.0.8 / 2011-11-25

  • Fixed: use Runner#total for accurate reporting

0.0.7 / 2011-11-25

  • Added Hook
  • Added Runnable
  • Changed: Test is Runnable
  • Fixed global leak reporting in hooks
  • Fixed: > 2 calls to done() only report the error once
  • Fixed: clear timer on failure. Closes #80

0.0.6 / 2011-11-25

  • Fixed return on immediate async error. Closes #80

0.0.5 / 2011-11-24

  • Fixed: make mocha.opts whitespace less picky [kkaefer]

0.0.4 / 2011-11-24

  • Added --interfaces
  • Added --reporters
  • Added -c, --colors. Closes #69
  • Fixed hook timeouts

0.0.3 / 2011-11-23

  • Added -C, --no-colors to explicitly disable
  • Added coffee-script support

0.0.2 / 2011-11-22

  • Fixed global leak detection due to Safari bind() change
  • Fixed: escape html entities in Doc reporter
  • Fixed: escape html entities in HTML reporter
  • Fixed pending test support for HTML reporter. Closes #66

0.0.1 / 2011-11-22

  • Added --timeout second shorthand support, ex --timeout 3s.
  • Fixed "test end" event for uncaughtExceptions. Closes #61

0.0.1-alpha6 / 2011-11-19

  • Added travis CI support (needs enabling when public)
  • Added preliminary browser support
  • Added make mocha.css target. Closes #45
  • Added stack trace to TAP errors. Closes #52
  • Renamed tearDown to teardown. Closes #49
  • Fixed: cascading hooksc. Closes #30
  • Fixed some colors for non-tty
  • Fixed errors thrown in sync test-cases due to nextTick
  • Fixed Base.window.width... again give precedence to 0.6.x

0.0.1-alpha5 / 2011-11-17

  • Added doc reporter. Closes #33
  • Added suite merging. Closes #28
  • Added TextMate bundle and make tm. Closes #20

0.0.1-alpha4 / 2011-11-15

  • Fixed getWindowSize() for 0.4.x

0.0.1-alpha3 / 2011-11-15

  • Added -s, --slow <ms> to specify "slow" test threshold
  • Added mocha-debug(1)
  • Added mocha.opts support. Closes #31
  • Added: default [files] to test/*.js
  • Added protection against multiple calls to done(). Closes #35
  • Changed: bright yellow for slow Dot reporter tests

0.0.1-alpha1 / 2011-11-08

  • Missed this one :)

0.0.1-alpha1 / 2011-11-08

  • Initial release