#4242: Enable running single test ---------------------------------------+------------------------------------ Reporter: garry.yao | Owner: garry.yao Type: New Feature | Status: assigned Priority: Normal | Milestone: CKEditor 3.1 Component: QA | Version: Keywords: Confirmed HasTest Review? | ---------------------------------------+------------------------------------
Old description: > In unit testing, previously we've been used the following trick a lot to > force executing only one specific test: > {{{ > // Run one specific test without registering to YUI runner. > window.onload = testCase.testName; > }}} > Now when adapting to our new testing system CKTester( #4218 ), the old > approach doesn't work at all, so this ticket > is intended to figure out a better way for achieving the same goal > without change CKTester. > > One official way ( from YUI Test functionality ) is to use the following > declaration on a test case: > {{{ > var oTestCase = new YAHOO.tool.TestCase({ > _should: { > ignore: { > testName: true //ignore this test > } > } > }); > }}} > 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: > {{{ > _should: { > ignoreAllBut: { > testName: true //ignore all tests except this, > comment this line to toggle it. > } > } > }}} > Test case written in this manner should be more easier to understand and > modify. New description: In unit testing, previously we've been used the following trick a lot to achieve: 1. Force executing only one specific test: 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. {{{ // Run one specific test without registering to YUI runner. window.onload = testCase.testName; }}} Now when adapting to our new testing system CKTester( #4218 ), the old approach doesn't work at all, so this ticket is intended to figure out a better way for achieving the above two goals without change CKTester. One official way ( from YUI Test functionality ) is to use this kind of 'meta instructions' on a test case: {{{ var oTestCase = new YAHOO.tool.TestCase({ _should: { ignore: { testName: true //ignore this test } } }); }}} We should be easily extend it with certain new instructions to support our above desired functionality: {{{ _should: { ignoreAllBut: { testName: true // Ignore all tests except this, comment this line to toggle it. }, throws: { testName: true // This test should throws exception instead of having it caught by runner. } } }}} With a little bit simplification, it could be written in the following form, which should be more easier to understand and modify. {{{ shouldIgnoreAllBut : [ 'testName' ], shouldThrows : [ 'testName' ] }}} -- Comment(by garry.yao): Update with the opinions from Fred. -- Ticket URL: <http://dev.fckeditor.net/ticket/4242#comment:5> FCKeditor <http://www.fckeditor.net/> The text editor for Internet ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ FCKeditor-Trac mailing list FCKeditor-Trac@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fckeditor-trac