0
我有一個與yeoman搭建的Angularjs項目,除了單元測試部分外,一切工作正常。測試在控制檯模式下工作(當我使用cmd中的grunt serve
或grunt test
),但是當我嘗試運行runner.html
文件以在瀏覽器上查看時,它沒有任何測試規格。 我的package.json依賴關係是這樣的:jasmine-html不能在瀏覽器中運行,但可以在控制檯中運行
"devDependencies": {
"grunt": "~0.4.5",
....
"karma-ng-scenario": "^0.1.0",
"grunt-karma": "^0.8.3",
"karma": "^0.12.23",
"karma-ng-html2js-preprocessor": "^0.1.0",
"karma-jasmine": "^0.2.2",
"karma-firefox-launcher": "^0.1.3",
"karma-chrome-launcher": "^0.1.4",
"grunt-ng-annotate": "^0.3.2",
"grunt-angular-templates": "^0.5.7"
}
,並在我的runner.html是這樣
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Jasmine Spec Runner v2.0.3</title>
<link rel="shortcut icon" type="image/png" href="lib-jasmine-2.0.3/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib-jasmine-2.0.3/jasmine.css">
<script type="text/javascript" src="lib-jasmine-2.0.3/jasmine.js"></script>
<script type="text/javascript" src="lib-jasmine-2.0.3/jasmine-html.js"></script>
<script type="text/javascript" src="lib-jasmine-2.0.3/boot.js"></script>
<!-- include source files here... -->
<!-- my angular and other libs scripts here -->
<!-- include spec files here... -->
<script src="mock/stateMock.js"></script>
<script src="spec/unit/controllers/main.js"></script>
<script src="spec/unit/services/survey.js"></script>
</head>
<body>
</body>
</html>
我應該怎麼做,使之在控制檯中運行什麼樣的?在此先感謝