Bug Tracker

Ticket #3628 (new enhancement)

Opened 2 months ago

Last modified 2 months ago

Module lifecycle doesn't support asynchronous methods (+opera.postError)

Reported by: greut Assigned to: joern
Type: enhancement Priority: major
Milestone: 1.3 Component: qunit
Version: 1.2.6 Keywords: qunit, testrunner
Cc: greut Needs: Review

Description

Hi, the following test, will not work with the current version of testrunner.js, because setup, callback and test aren't synchronized(see @5847).

module("Asynchronous setup", {
   setup: function() {
        window.global_is_evil = false;
        window.setTimeout(function() {
            window.global_is_evil = true;
            start();
        }, 1000);
        stop();
   }
});
test("Test after an asynchronous setup", function() {
   ok(window.global_is_evil, true, "Is global evil");
});

Find this patch that put each one into a sync call and the output takes also benefit of opera.postError (because console isn't supported).

Kind regards,

-- Yoan Blanc

Attachments

testrunner_async_lifecycle.js (2.4 kB) - added by greut 2 months ago.
setup/teardown are synced + opera.postError

Change History

Changed 2 months ago by greut

setup/teardown are synced + opera.postError

Changed 2 months ago by greut

ok(window.global_is_evil, true, "Is global evil");

should be:

equals(window.global_is_evil, true, "Is global evil");

Changed 2 months ago by flesler

  • cc set to greut
  • owner changed from flesler to joern
  • component changed from unfilled to qunit
Note: See TracTickets for help on using tickets.