Giter Site home page Giter Site logo

qunit-extras's People

Contributors

bnjmnt4n avatar greenkeeperio-bot avatar jdalton avatar mathiasbynens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

benpope82

qunit-extras's Issues

Screenshot of colors support

We used to have a screenshot on README.md, but it appears to have been removed. We should also add details about which environments colors work on.

Coloured terminal output

Adding support for coloured terminal output would be great. I can make a PR if you like. This should work in most terminals except Windows Command Prompt.

Cannot read property "parsers" from undefined

Since updating to the latest version of QUnit and the qunit-clib submodule for Punycode.js, testing under Narwhal throws errors.

The stack trace refers to this line: https://github.com/jdalton/qunit-clib/blob/4ff13811252dca88835c80e92714178321641631/qunit-clib.js#L117

Full log below.

$ export NARWHAL_OPTIMIZATION=-1; narwhal tests.js 
org.mozilla.javascript.EcmaError: TypeError: Cannot read property "parsers" from undefined (/Users/Mathias/Projects/punycode.js/vendor/qunit-clib/qunit-clib.js#117)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3753)
    at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3731)
    at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3759)
    at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3778)
    at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3791)
    at org.mozilla.javascript.ScriptRuntime.getObjectProp(ScriptRuntime.java:1487)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1399)
    at script(/Users/Mathias/Projects/punycode.js/vendor/qunit-clib/qunit-clib.js:117)
    at script(/Users/Mathias/Projects/punycode.js/vendor/qunit-clib/qunit-clib.js:116)
    at script(/Users/Mathias/Projects/punycode.js/vendor/qunit-clib/qunit-clib.js:7)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:845)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
    at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2504)
    at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:294)
    at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129)
    at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1._c_anonymous_6(Unknown Source)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1.call(Unknown Source)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1702)
    at script(/usr/local/Cellar/narwhal/0.3.2/libexec/packages/narwhal-lib/lib/narwhal/sandbox.js:118)
    at script(/Users/Mathias/Projects/punycode.js/tests/tests.js:4)
    at script(/Users/Mathias/Projects/punycode.js/tests/tests.js:1)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:845)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
    at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2504)
    at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:294)
    at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:129)
    at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1._c_anonymous_6(Unknown Source)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1.call(Unknown Source)
    at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1702)
    at script(/usr/local/Cellar/narwhal/0.3.2/libexec/packages/narwhal-lib/lib/narwhal/sandbox.js:118)
    at script(/usr/local/Cellar/narwhal/0.3.2/libexec/packages/narwhal-lib/lib/narwhal/sandbox.js:241)
    at script.narwhal(/usr/local/Cellar/narwhal/0.3.2/libexec/narwhal.js:290)
    at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:845)
    at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
    at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1._c_anonymous_1(Unknown Source)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1.call(Unknown Source)
    at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1._c_script_0(Unknown Source)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1.call(Unknown Source)
    at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
    at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1.call(Unknown Source)
    at org.mozilla.javascript.gen._usr_local_Cellar_narwhal_0_3_2_libexec_engines_rhino_bootstrap_js_1.exec(Unknown Source)
    at org.mozilla.javascript.tools.shell.Main.evaluateScript(Main.java:563)
    at org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:485)
    at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:451)
    at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:443)
    at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:196)
    at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:117)
    at org.mozilla.javascript.Context.call(Context.java:521)
    at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
    at org.mozilla.javascript.tools.shell.Main.exec(Main.java:179)
    at org.mozilla.javascript.tools.shell.Main.main(Main.java:157)
TypeError: Cannot read property "parsers" from undefined

I’m guessing something changed in QUnit. It sure was working fine before.

qunitjs should be a dependancy rather than a devDependency

$ npm install qunit-extras does not install qunitjs as a dependency unless run with the --dev flag.

Without qunitjs installed the tests can't run in node, so qunitjs should be a normal dependency - not a devDependency.

When running $ npm test I get: Error: Cannot find module 'qunitjs'. Can be fixed by running $npm install qunitjs or adding it as a dependency of my project but it should come bundled.

Test failures with v1.4.2

I get the following attempting to run the test suite:

$ npm test

> [email protected] test /home/mjo/src/qunit-extras-1.4.2
> node test/test.js

----------------------------------------
qunit-extras
----------------------------------------
 FAIL - Some other test with a title
    FAIL | EQ | foo | Expected: 2, Actual: 1
----------------------------------------
    PASS: 7  FAIL: 1  TOTAL: 8
    Finished in 17 milliseconds.
----------------------------------------
npm ERR! Test failed.  See above for more details.

I also have a request that I'd like to tack on =)

In test.js, you load qunit via a relative path:

load('../node_modules/qunitjs/qunit/qunit.js')

Would it be possible to replace that with a simple require('qunitjs')? The user may have qunit installed in his home directory or globally or somewhere else. Thank you!

Async tests using qunit-2.x APIs do not get retried

If using the new qunit-2.x APIs (already included with qunit-1.16 release) to define async tests, failed tests are not retried.

QUnit.config.asyncRetries = 5;

// Will be retried
asyncTest("old style async", function( assert ) {
    setTimeout(function() {
        ok(false);
        start();
    }, 1000);
});

// Will not retry
QUnit.test("new style async", function( assert ) {
    var done = assert.async();
    setTimeout(function() {
        assert.ok(false);
        done();
    }, 1000);
});

Reference:
http://qunitjs.com/upgrade-guide-2.x/

assert.deepEqual throws TypeError when comparing Symbols

When a comparison between arrays containing Symbols fails, rather than printing an error message the assert.deepEqual function throws a type error.

Failing code is:

QUnit.test('array of symbol comparision', assert => {
   assert.deepEqual([Symbol('aSymbol')], [5]); 
});

For a demo demonstrating the error please see: https://runkit.com/harrysarson/qunit-extras-symbols-bug.

I believe that somewhere [Symbol('mySymbol')].toString() is called which throws the error.

Interestingly the code fails in node v6.6 and v5.12 but not node v4.5.

Add tests

Add a few example tests for easy viewing the outputs of qunit-extras, eg test-passing.js, test-failing.js, run-tests.sh and index.html.

Remove trailing `|`

When a test fails, all other tests in that block get their result displayed as well. That’s fine, but it would be nice if we could get rid of the trailing | for passing tests in that case.

 FAIL - basic
    PASS | OK | object returned | 
    FAIL | EQ | values | Expected: a,b,c, Actual: a,x,c
    PASS | EQ | passed arguments to callback | 
    FAIL | EQ | exit early | Expected: a,b, Actual: a,x

qunit-clib on npm

It would be useful to have qunit-clib on npm so we don’t have to bother with Git submodules anymore.

Would you mind adding a package.json file and publishing qunit-clib to npm? Thanks!

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.