JavaScript???????????
???????????? ???????[ 2015/1/26 15:32:00 ] ????????JavaScript ??????????
?????????????????????????????????????????е?????????????????????
????QUnit??????????????????????????????????????е????в???????????????????????Щ???module()??????setup()??teardown()???????????????????????setup()???????????嵥6?????嵥10?????
?????嵥10. setup()??qunit/js/test-setup.js??
module ("Temperature conversion"?? { setup : function() { this.celsius1 = 20; this.celsius2 = 30; this.fahrenheit1 = 68; this.fahrenheit2 = 86; } }); test("conversion to F"?? function(){ var actual1 = convertFromCelsiusToFahrenheit(this.celsius1); equal(actual1?? this.fahrenheit1); var actual2 = convertFromCelsiusToFahrenheit(this.celsius2); equal(actual2?? this.fahrenheit2); }); test("conversion to C"?? function(){ var actual1 = convertFromFahrenheitToCelsius(this.fahrenheit1); equal(actual1?? this.celsius1); var actual2 = convertFromFahrenheitToCelsius(this.fahrenheit2); equal(actual2?? this.celsius2); });
???????????????????е???????setup?????????У????????????????????Щ???
????QUnit ?????asyncTest()??????????????????????????????Asynchronous JavaScript and XML??Ajax???????????????????????????????????????????????????У?expect()?????????????????????????????????е????????
????YUI Test????????????????????
????YUI Test??YUI??Yahoo!??????????????????????????????????????????????YUI Test?????????
????1. ??YUI???????HTML???????У?????.
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js" kesrc="http://yui.yahooapis.com/3.4.1 /build/yui/yui-min.js">< /script>
??????????д??????????????????????????YUI Test??汾3??
???????????????У??????YUI??????????????????test??console?????嵥11?????
?????嵥11. ????test??console??????YUI???
YUI().use("test"?? "console"?? function (Y) { // ???????????????? });
????test??????????????????????console?????????????????????????????????????????????????????????????????????????Y??????????????
????YUI Test???Y.Test.Case()?????????????????μ????????????????Y.Test.Suite()??????????????????????????????????JUnit??????????????????????????????????add()???????????????????????????С?
?????????????YUI Test???????嵥5?е???????嵥12??????????ò???????????????????????????
?????嵥12. ????????????????
YUI().use("test"?? "console"?? function (Y) { var suite = new Y.Test.Suite("Temperature conversion suite"); //add a test case suite.add(new Y.Test.Case({ name: "Temperature conversion? )); });
?????嵥12????????????Temperature conversion suite????????????????Temperature conversion??????????????????????????????????object literal???????д????????????????????????????????Y.Test.Case???????????嵥13?????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11