Giter VIP home page Giter VIP logo

api.qunitjs.com's People

Contributors

agcolom avatar ajpiano avatar arkni avatar arthurvr avatar aurelioderosa avatar ebenoist avatar fabiosantoscode avatar fcarstens avatar gibson042 avatar gnarf avatar jamesmgreene avatar jugglinmike avatar jzaefferer avatar krinkle avatar leobalter avatar makbeta avatar markelog avatar mikesherov avatar mixed avatar mlato-yahoo avatar piranna avatar rdworth avatar rwaldron avatar scottgonzalez avatar shivamdixit avatar tobiasoetzel avatar trentmwillis avatar

Stargazers

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

api.qunitjs.com's Issues

Incorrect code in documentation

Originally posted here: qunitjs/qunit#388 (comment)

On this page in the documentation: http://api.qunitjs.com/QUnit.moduleDone/

The code snippet looks like this;

QUnit.moduleStart(function( details ) {
    console.log( "Finished running: ", details.name, "Failed/total: ", details.failed, details.total );
});

Shouldn't it be this:

QUnit.moduleDone(function( details ) {
    console.log( "Finished running: ", details.name, "Failed/total: ", details.failed, details.total );
});

Document config

Stuff like requireExpect, reorder needs to be documented as well. Should probably go into a single document, with each config option as an <option> element.

Document module/test context and additional properties of lifecycle argument in module calls

We have a neat method of sharing code and objects between tests that existed for a long time, but was never documented:

QUnit.module( "setup test", {
    setup: function() {
        this.prop = "foo";
    },
    method: function() {
        return "bar";
    }
});

QUnit.test( "module with setup", function( assert ) {
    assert.ok( this.prop );
    assert.ok( this.method() );
});

In ember-qunit, this is used to provide helpers via moduleForComponent and other methods. We should document this, at least as part of QUnit.module.

Document QUnit.config.autostart

When set to false, user must call QUnit.init() and start() manually. Provide an example with AMD integration, something like this:

QUnit.config.autostart = false;
require(["test1", 'test2"], function() {
    QUnit.init();
    QUnit.start();
});

Example test for assert.throws fails

http://api.qunitjs.com/throws/

Sample: --> http://jsfiddle.net/legends77/3DVbS/

The last two throws fail.

First one:

 assert.throws(
          function () {
              throw new CustomError("some error description");
          },
              new CustomError("some error description")
        ,
        "raised error instance matches the CustomError instance"
        );

breaks here:

Died on test #4:
else if (actual instanceof expected)  [QUnit line: 1645]
^ TypeError: Expecting a function in instanceof check, but got [object Object]

Perhaps we can reuse the isEqual method from Underscore.js to check if these two objects are equal ?
Or did I misunderstand something?

Document QUnit.init

Old API site has this description:

Initialize the test runner (if the runner has already run it'll be re-initialized, effectively resetting it). This method does not need to be called in the normal use of QUnit.
This is useful for being able to use the test runner for multiple batches of dynamically-loaded tests (load a batch of tests, get the results, re-init, load a new batch, etc.).

NPM/Bower package names not fully legible

Something about the containing box for the npm/bower install lines on the top page makes the last few characters get cut off, as in this screenshot (Chrome/OSX):

k27zz3b]

If you copy-paste everything's fine, but just looking at it will give the wrong package name.


Edit: Attached image from imgur.com to the issue directly. โ€“@Krinkle

Document QUnit.jsDump.parse

Given QUnit.jsDump.parse's utility in defining custom assertions (and the unit tests backing its behavior [1] [2] [3]), the method appears to be part of the public API. Can someone on the team confirm this?

If so, then the documentation should be extended to describe its usage.

[1] https://github.com/jquery/qunit/blob/81d499b0fb06970b5f52185b8153416341c0d49e/test/test.js#L394-L402
[2] https://github.com/jquery/qunit/blob/81d499b0fb06970b5f52185b8153416341c0d49e/test/test.js#L667-L685
[3] https://github.com/jquery/qunit/blob/81d499b0fb06970b5f52185b8153416341c0d49e/test/test.js#L702-L728

Better Index Page

The index page should provide an overview of the docs, mention which version the docs apply to, where to find older versions, link to intro tutorials on the learn site, etc.

Document QUnit.skip

QUnit.skip is about to land on qunitjs/qunit#652 and we should document it before it's release.

Usage:

QUnit.skip( "test name here"[, callback] );

For the logs it does affect the testDone callback, inserting a skipped: true detail.

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.