3>,编写一个List.html文件作为调用Jasmine 和测试用例的入口文件,代码如下:
<html>
<head>
<title>Jasmine Spec Example</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-1.3.1/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.3.1/jasmine.css">
<script type="text/javascript" src="lib/jasmine-1.3.1/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.3.1/jasmine-html.js"></script>
<script type="text/javascript" src="spec/Lists.js"></script>
<script type="text/javascript">
var jasmineEnv = jasmine.getEnv();
var htmlReporter = new jasmine.HtmlReporter();
jasmineEnv.addReporter(htmlReporter);
jasmineEnv.specFilter = function(spec) {
return htmlReporter.specFilter(spec);
};
window.onload = function() {
jasmineEnv.execute();
};
</script>
</head>
<body>
</body>
</html>
  4>,在浏览器打开List.html文件,即可用查看 Lists.js 文件编写的测试用例的所有的执行结果报告,如果所测试用例执行错误,则会在界面上提示是哪个测试用例执行报错,如下图: