1
我正在开发一个AngularJS应用程序。我正在尝试对它进行一些测试。不幸的是,我似乎无法得到它的工作。我只是在我的控制台窗口中收到一条错误消息:“未捕获的ReferenceError:env未定义”。我已经复制了代码以运行AngularJS with Jasmine中的测试。我能看到的唯一区别是我引用了CDN。我有一个jsfiddle here,代码如下。茉莉花环未定义
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My Test Results</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine-html.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/boot.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular-mocks.js"></script>
<script type="text/javascript" src="res/js/angular-scenario.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.0.0/jasmine.css" />
<!-- Load the Test Files-->
<script type="text/javascript" src="e2e/tests.e2e.js"></script>
</head>
<body>
<a href="#" onclick="env.execute()">run tests</a>
</body>
</html>
我的tests.e2e.js文件的内容在小提琴中。作为参考,代码张贴如下:
'use strict';
describe('MyApp', function() {
describe('MyPage', function() {
it('should test', function() {
expect(true).toBe(false);
});
});
});
我做错了什么?