JasmineJS[unit test framework]

JasmineJS[unit test framework]

http://pivotal.github.com/jasmine/

1


<script src="../Scripts/unitTest/jasmine.js"></script>
<script src="../Scripts/unitTest/jasmine-html.js"></script>
<link href="../Scripts/unitTest/jasmine.css" rel="stylesheet" />

2


    var testBoolean, bar;
    it("假的測試", function () {
        foo = false;
        //expect(testBoolean).toEqual(true);//丟出錯誤
        expect(testBoolean).not.toEqual(true);
    });
});

3


    var jasmineEnv = jasmine.getEnv();
    jasmineEnv.updateInterval = 1000;
    var htmlReporter = new jasmine.HtmlReporter();
    jasmineEnv.addReporter(htmlReporter);
    jasmineEnv.execute();
})();

紀錄一下Smile