Changes between Initial Version and Version 5 of Ticket #4242


Ignore:
Timestamp:
Aug 16, 2009, 11:03:09 AM (15 years ago)
Author:
Garry Yao
Comment:

Update with the opinions from Fred.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4242

    • Property Status changed from new to assigned
    • Property Owner set to Garry Yao
    • Property Keywords HasTest Review? added
    • Property Milestone changed from CKEditor 3.0 to CKEditor 3.1
  • Ticket #4242 – Description

    initial v5  
    1 In unit testing, previously we've been used the following trick a lot to force executing only one specific test:
     1In unit testing, previously we've been used the following trick a lot to achieve:
     2 1. Force executing only one specific test:
     3 1. Running the test without the evolving of YUI runner, which means instead of having exceptions been caught by the runner, they were throwing to browser's default exception handling logic, which is more friendly for debugging.
    24{{{
    35// Run one specific test without registering to YUI runner.
     
    57}}}
    68Now when adapting to our new testing system CKTester( #4218 ), the old approach doesn't work at all, so this ticket
    7 is intended to figure out a better way for achieving the same goal without change CKTester.
     9is intended to figure out a better way for achieving the above two goals without change CKTester.
    810
    9 One official way ( from YUI Test functionality ) is to use the following declaration on a test case:
     11One official way ( from YUI Test functionality ) is to use this kind of 'meta instructions' on a test case:
    1012{{{
    1113var oTestCase = new YAHOO.tool.TestCase({
     
    1719});
    1820}}}
    19 But this is inconvenient when we want to ignore all tests but one, so I'm suggesting of '''extending YUI Test''' to support a more simpler syntax:
     21
     22We should be easily extend it with certain new instructions to support our above desired functionality:
    2023{{{
    2124        _should: {
    2225                ignoreAllBut: {
    23                         testName: true //ignore all tests except this, comment this line to toggle it.
     26                        testName: true // Ignore all tests except this, comment this line to toggle it.
     27                },
     28                throws: {
     29                        testName: true // This test should throws exception instead of having it caught by runner.
    2430                }
    2531        }
    2632}}}
    27 Test case written in this manner should be more easier to understand and modify.
     33With a little bit simplification, it could be written in the following form, which should be more easier to understand and modify.
     34{{{
     35        shouldIgnoreAllBut : [ 'testName' ],
     36        shouldThrows : [ 'testName' ]
     37}}}
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy