jquery/qunit — pull request #627 by leobalter (2014-08-13 17:16:23+00:00)
Title: Reporter: Implements the console reporter

Still missing tests (to be implemented)

The reporter needs to be activated to run, and the log functions are exposed so the user can hack it.

## Usage

```js
QUnit.console( [verbose] );
```

`verbose === true` trigger a more verbose reporter

## Examples:

### Tests failing on non-verbose mode:
```
$ grunt test-on-node
Running "test-on-node" task
..........................................................................................
Failed at
Module: recursions
Test: Failing - failed, expected argument to be truthy, was: false

Failed at
Module: recursions
Test: Failing - [1] == 1
expected: 1
actual : [
1
]

Failed at
Module: recursions
Test: Failing - (annonymous assertion)
expected: 2
actual : 1

Failed at
Module: recursions
Test: Failing - (annonymous assertion)
expected: [
1,
3
]
actual : [
1,
2
]

Failed at
Module: recursions
Test: Failing - Expected 100 assertions, but 4 were run
.................................................................................................................................................................................................................................................
FAILED 5 from 336 assertions (98.51% okay) in 1714ms
Warning: Task "test-on-node" failed. Use --force to continue.

Aborted due to warnings.
```

### Tests passing on non-verbose mode:

```
$ grunt test-on-node
Running "test-on-node" task
...........................................................................................................................................................................................................................................................................................................................................OK

331 assertions passed (100% okay) in 1712ms

Done, without errors.
```

### Tests passing on verbose mode:

```
$ grunt test-on-node --verbose
Running "test-on-node" task
# deprecated log methods - after QUnit.init() ..
2 from 2 assertions passed (100%) in 2ms
# deprecated log methods - QUnit.reset()
0 from 0 assertions passed (100%) in 0ms
# deprecated log methods - module without setup/teardown (default) .
1 from 1 assertions passed (100%) in 0ms
# deprecated log methods - expect in test ...
3 from 3 assertions passed (100%) in 0ms
# deprecated log methods - expect in test .
1 from 1 assertions passed (100%) in 0ms
# deprecated log methods - expect query and multiple issue ...
3 from 3 assertions passed (100%) in 0ms
# setup test - module with setup ..
2 from 2 assertions passed (100%) in 0ms
# setup test - module with setup, expect in test call ..
2 from 2 assertions passed (100%) in 0ms
# setup/teardown test - module with setup/teardown ...
3 from 3 assertions passed (100%) in 0ms
# setup/teardown test 2 - module without setup/teardown .
1 from 1 assertions passed (100%) in 0ms
# Date test - sample test for Date test .
1 from 1 assertions passed (100%) in 0ms
# teardown and stop - teardown must be called after test ended .
1 from 1 assertions passed (100%) in 34ms
# teardown and stop - parameter passed to stop increments semaphore n times .
1 from 1 assertions passed (100%) in 29ms
# teardown and stop - parameter passed to start decrements semaphore n times .
1 from 1 assertions passed (100%) in 32ms
# async setup test - module with async setup ..
2 from 2 assertions passed (100%) in 528ms
# async teardown test - module with async teardown ..
2 from 2 assertions passed (100%) in 530ms
# asyncTest - asyncTest ..
2 from 2 assertions passed (100%) in 30ms
# asyncTest - asyncTest with expect() ..
2 from 2 assertions passed (100%) in 29ms
# asyncTest - sync ..
2 from 2 assertions passed (100%) in 140ms
# asyncTest - test synchronous calls to stop ..
2 from 2 assertions passed (100%) in 315ms
# save scope - scope check ..
2 from 2 assertions passed (100%) in 1ms
# simple testEnvironment setup - scope check .
1 from 1 assertions passed (100%) in 0ms
# simple testEnvironment setup - modify testEnvironment
0 from 0 assertions passed (100%) in 0ms
# simple testEnvironment setup - testEnvironment reset for next test .
1 from 1 assertions passed (100%) in 0ms
# testEnvironment with object - scope check .
1 from 1 assertions passed (100%) in 0ms
# testEnvironment with object - modify testEnvironment
0 from 0 assertions passed (100%) in 1ms
# testEnvironment with object - testEnvironment reset for next test .
1 from 1 assertions passed (100%) in 0ms
# testEnvironment tests - makeurl working ..
2 from 2 assertions passed (100%) in 1ms
# testEnvironment with makeurl settings - makeurl working with settings from testEnvironment .
1 from 1 assertions passed (100%) in 0ms
# dump - dump output ..
2 from 2 assertions passed (100%) in 1ms
# dump - dump, TypeError properties ....
4 from 4 assertions passed (100%) in 1ms
# assertions - propEqual .....
5 from 5 assertions passed (100%) in 1ms
# assertions - throws ................
16 from 16 assertions passed (100%) in 3ms
# custom assertions - mod2 ..
2 from 2 assertions passed (100%) in 0ms
# recursions - Check dump recursion ....
4 from 4 assertions passed (100%) in 2ms
# recursions - Check equal/deepEqual recursion ......
6 from 6 assertions passed (100%) in 0ms
# recursions - Circular reference with arrays ......
6 from 6 assertions passed (100%) in 0ms
# recursions - Circular reference - test reported by soniciq in #105 ..
2 from 2 assertions passed (100%) in 0ms
# equiv - Primitive types and constants ........................................................................................
88 from 88 assertions passed (100%) in 4ms
# equiv - Objects basics .................
17 from 17 assertions passed (100%) in 0ms
# equiv - Arrays basics ....................
20 from 20 assertions passed (100%) in 2ms
# equiv - Functions ..........
10 from 10 assertions passed (100%) in 1ms
# equiv - Date instances ...
3 from 3 assertions passed (100%) in 0ms
# equiv - RegExp ..........................
26 from 26 assertions passed (100%) in 1ms
# equiv - Complex objects ................
16 from 16 assertions passed (100%) in 2ms
# equiv - Complex Arrays .......
7 from 7 assertions passed (100%) in 2ms
# equiv - Prototypal inheritance .......
7 from 7 assertions passed (100%) in 0ms
# equiv - Instances .......
7 from 7 assertions passed (100%) in 1ms
# equiv - Complex instance nesting (with function values in literals and/or in nested instances) ......
6 from 6 assertions passed (100%) in 2ms
# equiv - Object with circular references ...
3 from 3 assertions passed (100%) in 0ms
# equiv - Array with circular references ...
3 from 3 assertions passed (100%) in 0ms
# equiv - Mixed object/array with references to self wont loop ...
3 from 3 assertions passed (100%) in 1ms
# equiv - Compare self-referent to tree ......
6 from 6 assertions passed (100%) in 0ms
# equiv - Test that must be done at the end because they extend some primitive's prototype ..
2 from 2 assertions passed (100%) in 0ms
# globals - QUnit object .
1 from 1 assertions passed (100%) in 0ms
# globals - QUnit exported methods ..........
10 from 10 assertions passed (100%) in 1ms
# globals - Exported assertions ......
6 from 6 assertions passed (100%) in 0ms

331 assertions passed (100% okay) in 1721ms

Done, without errors.
```