testingAngularJS express节点的应用程序

我有一个与jasmine-nodemocha (与zombie )testing我的应用程序的问题。 重点是angular不适用于这个testing环境 – 当browser.visit "http://localhost:3000/"它只显示布局,并且不显示任何模板链接 。 我猜javascript不会在浏览器(我的意思是僵尸对象)中运行。 我的testing是否有任何方法使其工作? 或者问题是不同的?

在茉莉花规范,我从另一个项目规范复制发生错误:

 /home/alder/Node/angular-express-coffee/spec/app_spec.coffee:12 throw error; ^ ReferenceError: angular is not defined at /js/services.js:4:3 at /js/services.js:6:4 in /js/services.js 

所以我想JavaScript不起作用。

更新:我添加debugging选项,并在这里显示它:

 ➜ angular-express-coffee git:(master) ✗ mocha --require should --compilers coffee:coffee-script --colors -R spec --ui bdd Given I am a new user When I visit the home page Zombie: GET http://localhost:3000/newPost => 200 Zombie: GET http://localhost:3000/ => 200 Zombie: GET http://localhost:3000/js/lib/jquery-1.7.2.min.js => 200 Zombie: GET http://localhost:3000/js/lib/bootstrap.min.js => 200 Zombie: GET http://localhost:3000/js/lib/angular.min.js => 200 Zombie: GET http://localhost:3000/js/app.js => 200 Zombie: GET http://localhost:3000/js/controllers.js => 200 Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/controllers.js Zombie: GET http://localhost:3000/js/lib/jquery-1.7.2.min.js => 200 Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/lib/jquery-1.7.2.min.js Zombie: GET http://localhost:3000/js/filters.js => 200 Zombie: GET http://localhost:3000/js/directives.js => 200 Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/directives.js Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/filters.js Zombie: GET http://localhost:3000/js/lib/bootstrap.min.js => 200 Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/lib/bootstrap.min.js Zombie: GET http://localhost:3000/js/lib/angular.min.js => 200 Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/lib/angular.min.js Zombie: GET http://localhost:3000/js/services.js => 200 Zombie: GET http://localhost:3000/js/filters.js => 200 Zombie: GET http://localhost:3000/js/directives.js => 200 Zombie: GET http://localhost:3000/js/controllers.js => 200 Zombie: GET http://localhost:3000/js/app.js => 200 Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/app.js Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/controllers.js Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/directives.js Zombie: Unexpected token ILLEGAL SyntaxError: Unexpected token ILLEGAL in /js/filters.js Zombie: GET http://localhost:3000/js/services.js => 200 

也许咖啡的问题,但我有select摩卡。 是否有任何方法来testingangular度的应用程序没有JsTestDriver由Angular团队宣传。

更新。 我已经改变了错误断言browser.errors.should.be.empty ,它显示了我一个错误:

 1) Given I am a new user When I visit the home page Then browser status shold be ok: AssertionError: expected [ [Error: Unexpected token ILLEGAL], [Error: Unexpected token ILLEGAL], [Error: Unexpected token ILLEGAL], [Error: Unexpected token ILLEGAL], [Error: Unexpected token ILLEGAL], [Error: Unexpected token ILLEGAL], [Error: Unexpected token ILLEGAL], [Error: angular is not defined] ] to be empty at Object.empty (/home/alder/Node/angular-express-coffee/node_modules/should/lib/should.js:229:10) at Context.<anonymous> (/home/alder/Node/angular-express-coffee/test/app_test.coffee:31:40) at Test.Runnable.run (/usr/lib/node_modules/mocha/lib/runnable.js:184:32) at Runner.runTest (/usr/lib/node_modules/mocha/lib/runner.js:300:10) at Runner.runTests.next (/usr/lib/node_modules/mocha/lib/runner.js:346:12) at next (/usr/lib/node_modules/mocha/lib/runner.js:228:14) at Runner.hooks (/usr/lib/node_modules/mocha/lib/runner.js:237:7) at next (/usr/lib/node_modules/mocha/lib/runner.js:185:23) at Runner.hook (/usr/lib/node_modules/mocha/lib/runner.js:205:5) at process.startup.processNextTick.process._tickCallback (node.js:244:9) 

最后更新:问题是在资产pipe道,所有js被禁用Zombie浏览器。 现在我从咖啡转换到js,它工作。 但我更喜欢咖啡,所以如果有人能解决它,我会很感激。

你有没有试过Angular Scenario Runner ?

是因为摩卡吗? 我听说它会因为它的名字而导致问题