???????getFactorial??????????????д????3???????????
????????????????

// Factorial testing module
module("Factorial"?? {
setup: function() {
this.simpleMath = new SimpleMath();
}?? teardown: function() {
delete this.simpleMath;
}
});
test("calculating factorial for a positive number"?? function() {
equal(this.simpleMath.getFactorial(3)?? 6?? "Factorial of three must equal six");
});
test("calculating factorial for zero"?? function() {
equal(this.simpleMath.getFactorial(0)?? 1?? "Factorial of zero must equal one");
});
test("throwing an error when calculating the factorial for a negative number"?? function() {
raises(function() {
this.simpleMath.getFactorial(-10)
}?? "There is no factorial for negative numbers ...");
});
?????????????У?module????setup?? teardown??????????????o????Щ????????????equal????3????????6????????н????Java??C#?????????????ò??????????????2??js??????????????html??
????<script src="src/simpleMath.js"></script>
????<script src="tests/simpleMathTest.js"></script>
??????????????????д????html??????????????????
??????????????????7???????????????????????????2??????????????????????????????????ok( truthy [?? message ] )?? deepEqual( actual?? expected [?? message ] )????????ok:
????ok(true?? "true passes");
????ok(4==4?? "4 must equal 4");
????ok("some string"?? "Non-empty string passes");
????QUnit????????ajax????????asyncTest?????????????????????????????д??????μ????QUnit??v1.14.0?汾???δ??????????°汾????????????????ο?API?????
???????????????????а?????