简体   繁体   English

AppEngine Python项目中的AngularJS / Karma单元测试

[英]AngularJS / Karma Unit testing in AppEngine Python project

I'm experimenting with AngularJS on top of GAE/Python. 我正在GAE / Python之上使用AngularJS进行实验。 I tried moving in a few bootstrap template files and I'm not getting the following errors in my Unit tests (default unit tests). 我尝试移动一些引导程序模板文件,但在单元测试(默认单元测试)中未收到以下错误。

Source: https://github.com/m2mIO/angular-portal 资料来源: https : //github.com/m2mIO/angular-portal

Starting Karma Server (http://karma-runner.github.io)
-------------------------------------------------------------------
WARN [config]: "/" is proxied, you should probably change urlRoot to avoid conflicts
WARN [plugin]: Cannot find plugin "karma-junit-reporter".
  Did you forget to install it ?
  npm install karma-junit-reporter --save-dev
WARN [proxy]: proxy "http://localhost:8080" normalized to "http://localhost:8080/"
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 30.0.1599 (Mac OS X 10.8.5)]: Connected on socket 4fu9UWsj1npbCkHr1G-4
Chrome 30.0.1599 (Mac OS X 10.8.5) ERROR
    Uncaught ReferenceError: jQuery is not defined
    at /Users/kyleroche/PycharmProjects/2lemetry/app/js/fullcalendar.min.js:7
Chrome 30.0.1599 (Mac OS X 10.8.5) ERROR
    Uncaught ReferenceError: jQuery is not defined
    at /Users/kyleroche/PycharmProjects/2lemetry/app/js/gcal.js:107
Chrome 30.0.1599 (Mac OS X 10.8.5) ERROR
    Uncaught ReferenceError: jQuery is not defined
    at /Users/kyleroche/PycharmProjects/2lemetry/app/js/jquery-ui-1.10.2.custom.min.js:6
Chrome 30.0.1599 (Mac OS X 10.8.5) ERROR
    Uncaught ReferenceError: jQuery is not defined
    at /Users/kyleroche/PycharmProjects/2lemetry/app/js/jquery.dataTables.js:39
Chrome 30.0.1599 (Mac OS X 10.8.5) ERROR
    Uncaught ReferenceError: jQuery is not defined
    at /Users/kyleroche/PycharmProjects/2lemetry/app/js/jquery.flot.js:32
Chrome 30.0.1599 (Mac OS X 10.8.5): Executed 0 of 0 ERROR (0.716 secs / 0 secs)

I'm also not exactly sure what to add to my app.yaml to serve the e2e tests. 我也不确定要添加什么到我的app.yaml中以进行e2e测试。 They are located in test/e2e/runner.html. 它们位于test / e2e / runner.html中。

I figured this out. 我想通了。 Used exclude for template files and had to server /test from static assets dir. 用于模板文件排除,并且必须从静态资产目录进行服务器/测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM