Coder Social home page Coder Social logo

qutest's Introduction

QUTest is a QUnit based unit test runner. It was mainly created for simplifying the execution of unit tests from the command line with phantomjs.

Running tests from the command line

In order to run tests with phantomjs from the commandline you need to install phantomjs on your machine, and then run:
./run TESTFILE_1 [...[TESTFILE_N]]

For example: ./run example-test-*

Instructions for building phantomjs are found there: http://code.google.com/p/phantomjs/wiki/BuildInstructions

On Mac or Windows, you can use the binaries from here: http://code.google.com/p/phantomjs/downloads/list

Your testcases should be written in JavaScript (or possibly compiled from e.g. CoffeeScript to JavaScript) and can make use of either or both of QUnit and Pavlov.

It's possible to customize ouput a bit, e.g.:
./run example-test-*.js --show-colors=0 --show-passed-tests=1

(Check the CONFIG in test-runner.coffee for more possible configurations.)

Running tests from any web browser

You can also run the tests from any browser.

(For your convenience, when tests are executed with phantomjs from the command line the test runner will also print the corresponding URL for the tests, so that you can easily run the tests in your browser(s) as well.)

To run the bundled test examples, open this URL in your web browser:

file://cwd/test.html?injects=example-test-qunit.js,example-test-pavlov.js (cwd should be the full path to the current directory.)

For your convenience, run something like this from your terminal: x-www-browser file://$(pwd)/test.html?injects=$(echo *.js | tr ' ' ,)

Replace x-www-browser with open in OS X.

Testing QUTest

QUTest itself is automatically tested on BuildHive.

Build Status

qutest's People

Contributors

andreineculau avatar douglas-jenkins avatar isakb avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.