I download the code and rake for "setUp" and find the following:
javascript/TestCaseBuilder.js: if (typeof testCaseClass.prototype.setUp == 'undefined') {
javascript/TestCaseBuilder.js: testCaseClass.prototype.setUp = function() {};
javascript/plugins/TestRunnerPlugin.js: if (testCaseInstance.setUp) {
javascript/plugins/TestRunnerPlugin.js: testCaseInstance.setUp();
And similar for "tearDown":
javascript/TestCaseBuilder.js: if (typeof testCaseClass.prototype.tearDown == 'undefined') {
javascript/TestCaseBuilder.js: testCaseClass.prototype.tearDown = function() {};
javascript/plugins/TestRunnerPlugin.js: if (testCaseInstance.tearDown) {
javascript/plugins/TestRunnerPlugin.js: testCaseInstance.tearDown();
Thus, it seems that the setUp and tearDown functions are defined just like any other test function, except that their name is "setUp" and "tearDown". Their example:
GreeterTest = TestCase("GreeterTest");
GreeterTest.prototype.testGreet = function() {
var greeter = new myapp.Greeter();
assertEquals("Hello World!", greeter.greet("World"));
};
, js- , 'prototype' ( javascript), YUI vids
, setUp tearDown, , , , .
, setUp, tearDown .
, Selenium ( )