JavaScript???????????
???????????? ???????[ 2015/1/26 15:32:00 ] ????????JavaScript ??????????
module ("Temperature conversion") test("conversion to F"?? function(){ var actual1 = convertFromCelsiusToFahrenheit(20); equal(actual1?? 68?? ?Value not correct?); var actual2 = convertFromCelsiusToFahrenheit(30); equal(actual2?? 86?? ?Value not correct?); }) test("conversion to C"?? function(){ var actual1 = convertFromFahrenheitToCelsius(68); equal(actual1?? 20?? ?Value not correct?); var actual2 = convertFromFahrenheitToCelsius(86); equal(actual2?? 30?? ?Value not correct?); })
????QUnit?е??????????test()?????????壬??????????????ú??????????????С????嵥6?У????????????????????conversion to F??conversion to C???????????????????????????Щ????????е??????????equal()??????equal()????????????????????????????????????? equal()?????е????????????????????????????????
?????????????module()?????????Щ???????????顣???嵥6?У????Temperature conversion????????????
?????????????Щ?????
????1. ??????????????????HTML???????У????嵥7???.
????2. ????????д???HTML??檔
?????嵥7. ?????????а???script.js??test.js
... <script type="text/javascript" src="js/script.js" kesrc="js/script.js">< /script> <script type="text/javascript" src="js/test.js" kesrc="js/test.js">< /script> ...
?????1????QUnit?????????Firefox????????????????
?????1. QUnit???
?????嵥6?е?????????equal()????????????QUnit????????QUnit?????????Щ?????????ok()?? strictEqual()???嵥8????????Щ?????????÷????
?????嵥8. ????????
module ("Other assertion"); test("assertions"?? function(){ ok(true); ok(3); strictEqual("c"?? "c"); equal (3?? "3"); });
????ok()????????????????true??strictEqual()??????????????????????????????????strictEqual()?????===????????? equal()??????==???????
??????????????????QUnit??????Щ?????????????嵥8?е?????????嵥9?е????????????????????
?????嵥9. ???????????????
module ("Other assertion"); test("assertions"?? function(){ ok(true); ok(3); strictEqual("c"?? "c"); strictEqual (3?? "3"); });
?????2?????嵥9?е?????QUnit????????
?????2. QUnit???——????????????
??????
???·???
??????????????????
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