Git Product home page Git Product logo

whiskey's Introduction

Whiskey

Whiskey is a simple test runner for NodeJS applications.

Features

  • Each test file is run in a separate process
  • Support for a test file timeout
  • Support for a "failfast mode" (runner exits after a first failure / timeout)
  • setUp / tearDown function support
  • Support for a global initialization function which is run once before all the tests
  • Support for a test initialization function which is run before running the tests in a test file
  • Nicely formatted output (colors!)

TODO

Screenshot

Console output

Dependencies

  • optparse-js
  • async
  • sprintf

Changes

  • 15.04.2011 - v0.2.3:

    • Better reporting on a test file timeout
    • Properly report if a test file does not exist or some other uncaught exception was thrown
    • Fix a bug with output buffer not being fully flushed on exit on OS X
    • add --print-stdout and --print-stderr option
  • 30.03.2011 - v0.2.2:

    • Add timeout support to the init, setUp and tearDown function - if the callback passed to one of those functions is not called in timeout milliseconds, an exception is thrown and test execution is aborted
    • Test timeout is now properly reported as a failure
  • 27.03.2011 - v0.2.1:

    • Handle uncaughtExceptions better
    • Use lighter colors so test status output is more distinguishable
    • Fix bug with "cannot find module" exception not being properly reported
    • Add support for per-test file init function / file
    • Print stdout and stderr on failure
  • 26.03.2011 - v0.2.0

    • Add support for the failfast mode (runner exists after a first failure)
    • User can specify custom test timeout by passing in the --timeout argument
    • Add support for a setUp and tearDown function
    • Add colors to the output
    • Now each test file must export all the test functions so the runner can iterate over them
    • Add support for a global initialization file / function (init function in this file is run before all the tests in a main process and can perform some kind of global initialization)
    • Add support for --chdir argument
  • 25.03.2011 - v0.1.0

    • Initial release (refactor module out from Cast and move it into a separate project)

Installation

Install it using npm: npm install whiskey

Usage

whiskey [options] --tests <test files>

Available options

-t, --tests - Whitespace separated list of test files to run
-i, --init-file - A path to the initialization file which must export init function which is called once in the main process before running the tests
-ti, --test-init-file - A path to the initialization file which must export
init function and it is called in a child process before running the tests in each test file
-c, --chdir - An optional path to which the child process will chdir to before running the tests
-f, --failfaist - Use this option to exit upon first failure / timeout

Note: When specifying multiple test a list with the test paths must be quoted, for example: whiskey --tests "tests/a.js tests/b.js tests/c.js"

Examples

For examples, check the example folder.

whiskey's People

Contributors

kami avatar

Stargazers

Ryan Phillips avatar

Watchers

James Cloos avatar  avatar

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.