Changes between Initial Version and Version 9 of Ticket #6959


Ignore:
Timestamp:
Dec 12, 2011, 1:15:02 AM (10 years ago)
Author:
bill
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6959

    • Property Status changed from new to assigned
    • Property Owner changed from alex to dylan
    • Property Milestone changed from 1.2 to future
    • Property Summary changed from simplified doh testing to [patch][cla] simplified doh testing
  • Ticket #6959 – Description

    initial v9  
    55For synchronous testing:
    66
    7 [code]
     7{{{
    88dojo.declare("MySynchronousTestFixture", test.TestFixture, {
    99   setUp:function() {
     
    1212   }
    1313});
    14 [/code]
     14}}}
    1515
    1616Then you register your tests as usual, but if you declare your
     
    2222test. Thirdly you get your assertions without any prefixes, as follows:
    2323
    24 
     24{{{
    2525doh.register("myTests",[
    2626   new MySynchronousTestFixture("firstTest", function() {
     
    3030   });
    3131]);
    32 
     32}}}
    3333
    3434This is extended to include very simple support for asynchronous tests:
    3535
    36 
     36{{{
    3737dojo.declare("MySynchronousTestFixture", test.AsyncTestFixture, {
    3838   setUp:function() {
     
    4141   }
    4242});
    43 
     43}}}
    4444
    4545and usage is really a snap:
    4646
    47 
     47{{{
    4848doh.register("myTests",[
    4949   new MySynchronousTestFixture("firstTest", function() {
     
    5353   });
    5454]);
    55 
     55}}}
    5656
    5757and if you want to test something asynchronous that does not return a deferred, its still very easy:
    5858
     59{{{
    5960doh.register("myTests",[
    6061   new MySynchronousTestFixture("firstTest", function() {
     
    6465   });
    6566]);
    66 
     67}}}
    6768
    6869Perhaps this is just a stylistic issue, but I think these tests are a lot easier to read and to write, with less of
    6970a learning curve to figure out how to do asynchronous testing. And its all just added bonus.
    7071
    71 I've attached the code for test.TestFixture and test.AsyncTestFixture. I hope you will consider adding this, or something like this to doh.
     72I've attached the code for test.!TestFixture and test.!AsyncTestFixture. I hope you will consider adding this, or something like this to doh.
    7273