| Page 1 of 1 | [ 4 posts ] |
|
I've been trying to move some javascript tests into the YUITest framework and I'm confused. It seems that two different pages on yuilibrary.com show much different techniques fro creating test cases. On http://yuilibrary.com/yui/docs/test/ to create a test case you do something like:
Code: var testCase = new Y.Test.Case({... And you have to do that within the context of something like: Code: YUI().use('test', function (Y) {... But on http://yuilibrary.com/yuitest/ you create a test case in this way: Code: var testCase = new YUITest.TestCase({... ... and there seems to be no required context. I'm not sure what the difference is. Is one of these not really correct? Or are there tradeoffs between the two approaches? |
|
`Y.Test.Case` is when you use the version of YUI Test inside a YUI instance like:
Code: YUI().use('test', function(Y) { //Y.Test.Case }); The `YUITest` global object is if you are using the stand alone YUI Test module (that has no dependency on YUI being on the page. |
|
I don't know if this would be recommended practice but I was creating a page from scratch from which I would test some javascript. It would include the javascript files I had written and test with the objects and functions in those javascript files. So, since it's being written from scratch and doesn't already have YUI on it for other purposes, I should use the standalone version. Is that correct?
Or is either version equally reasonable? |
|
They are both the same code under the hood. The stand-alone version is newer than the 3.4.1 release of YUI. But the 3.5.0pr4, released last week, is identical to the latest stand alone code.
So it's really up to you on how you want to use it |
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group