Changes between Initial Version and Version 5 of Ticket #4242
- Timestamp:
- Aug 16, 2009, 11:03:09 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #4242
-
Property
Status
changed from
new
toassigned
- Property Owner set to Garry Yao
- Property Keywords HasTest Review? added
-
Property
Milestone
changed from
CKEditor 3.0
toCKEditor 3.1
-
Property
Status
changed from
-
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: 1 In 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. 2 4 {{{ 3 5 // Run one specific test without registering to YUI runner. … … 5 7 }}} 6 8 Now 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 goalwithout change CKTester.9 is intended to figure out a better way for achieving the above two goals without change CKTester. 8 10 9 One official way ( from YUI Test functionality ) is to use th e following declarationon a test case:11 One official way ( from YUI Test functionality ) is to use this kind of 'meta instructions' on a test case: 10 12 {{{ 11 13 var oTestCase = new YAHOO.tool.TestCase({ … … 17 19 }); 18 20 }}} 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 22 We should be easily extend it with certain new instructions to support our above desired functionality: 20 23 {{{ 21 24 _should: { 22 25 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. 24 30 } 25 31 } 26 32 }}} 27 Test case written in this manner should be more easier to understand and modify. 33 With 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 }}}