【发布时间】:2016-07-21 02:08:57
【问题描述】:
我在单元测试中使用 angular 版本 1 和 jasmine。
我想做的测试是:
例如,当我在 ie7 中加载 index.html 页面时,我加载了一个 html 横幅,上面写着下载最新的浏览器。
我目前正在索引页面上使用 JQuery 加载一个 html 模板。
是否可以测试它,因为它在 Angular 应用程序之外。
这是我在 index.html 页面上的当前代码:
<!doctype html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<base href="/app/" />
<!-- Is Angular supported -->
<script>
if(window.angular === undefined)
$(function(){$("#angularNotSupportedModal").load("/app/noAngularModal.html");});
</script>
</head>
<body ng-app="app" ng-cloak>
<div id="angularNotSupportedModal"></div>
<div ui-view></div>
<!-- Application -->
<script src="/scripts/app.js"></script>
<!-- Config -->
<script src="/scripts/config.js"></script>
</body>
</html>
任何建议都会很棒。
谢谢
【问题讨论】:
标签: javascript jquery angularjs unit-testing jasmine