Opened 12 years ago

Closed 12 years ago

#3504 closed defect (fixed)

doh.registerGroup setUp and tearDown doesn't work

Reported by: mumme Owned by: Jared Jurkiewicz
Priority: high Milestone: 0.9
Component: TestFramework Version: 0.9
Keywords: doh.runner registerGroup Cc:
Blocked By: Blocking:

Description

Hi !

When trying to figure out how the new unit test system works, I could never get registerGroup setUp and tearDown args to work as documented.

Trying the sample from: http://dojotoolkit.org/book/dojo-porting-guide-0-4-x-0-9/test-system-changes

// file located in core at:
//      tests/fullGroupTest.js
dojo.provide("tests.fullGroupTest");
dojo.require("tests.runner");

tests.registerGroup("tests.fullGroupTest",
        [
                // single test, no test fixture
                function assertTrueTest(t){ t.t(true); },
                // string variant of the same:
                "tests.t(true);",
                // test that uses variable set up by group
                function assertTrueTest(t){
                        t.t(tests.fullGroupTest._localVariable);
                },
                // ...
        ],
        function(){ // setUp
                tests.fullGroupTest._localVariable = true;
        },
        function(){ // tearDown
                tests.fullGroupTest._localVariable = false;
        }
);

Fails because setUp is never called.

Regards Fredrik Johansson

Attachments (1)

dojo_doh_20070802.patch (780 bytes) - added by Jared Jurkiewicz 12 years ago.
Simple patch for this problem.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 12 years ago by Jared Jurkiewicz

Owner: changed from alex to Jared Jurkiewicz

comment:2 Changed 12 years ago by Jared Jurkiewicz

Status: newassigned

Changed 12 years ago by Jared Jurkiewicz

Attachment: dojo_doh_20070802.patch added

Simple patch for this problem.

comment:3 Changed 12 years ago by Jared Jurkiewicz

Problem was that the group level execution merely wasn't calling the group level setup and teardowns. Easy enough to fix.

comment:4 Changed 12 years ago by Jared Jurkiewicz

Resolution: fixed
Status: assignedclosed

(In [9929]) Fixing minor test harness issue. fixes #3504

Note: See TracTickets for help on using tickets.