Tag: 业力运行者

业力错误'没有时间戳'

试图得到有关运用requirejs的业力。 我不明白为什么我在运行Karma时遇到了所有这些错误: ERROR: 'There is no timestamp for /base/test/mainSpec.js?bust=1387739317116!' ERROR: 'There is no timestamp for /base/app/main.js?bust=1387739317116!' ERROR: 'There is no timestamp for /base/bower_components/jquery/jquery.js?bust=1387739317116!' 当我去检查员的networking选项卡时,所有的文件都没有404s。 我有点困惑,因为业力似乎在寻找一个“基地”的目录,但没有在我的项目中的“基地”目录。 根据业力文件: Karma提供/ base目录下的文件。 所以,在服务器上,对文件的请求将在http://localhost:9876/base/* 。 baseUrl的Require.jsconfiguration为使用相对path加载的模块提供了启动上下文。 为Karma服务器设置此值时,需要以/ base开头。 我们希望我们testing的baseUrl与src / main.js中的基础url是相同的文件夹,这样在源文件中的相对需求就不需要改变。 所以,因为我们希望我们的基址在src /,我们需要写/ base / src。 这个混乱至less可以说。 我应该在我的main.js文件中指向“/ base”的baseUrlconfiguration?

如何在业力unit testing中修复404图像的警告

我使用grunt / karma / phantomjs / jasmine来testing我的一个指令(angularjs)。 我的testing运行良好 describe('bar foo', function () { beforeEach(inject(function ($rootScope, $compile) { elm = angular.element('<img bar-foo src="img1.png"/>'); scope = $rootScope.$new(); $compile(elm)(); scope.$digest(); })); …. }); 但我确实得到这些404 WARN [web-server]: 404: /img1.png WARN [web-server]: 404: /img2.png … 虽然他们什么都不做,他们确实增加了对日志输出的噪音。 有没有办法来解决这个问题 ? (当然不会改变业力的logLevel,因为我确实想看到它们)

在安装后运行业力导致“业力”不被识别为内部或外部命令

我试图运行业力作为angular色种子项目的一部分,使用后安装业力 npm install -g karma 我得到: 'karma' is not recognized as an internal or external command, operable program or batch file. 当我试图从angular-client \ scripts运行test.bat时,这个文件的内容是: 设置BASE_DIR =%〜dp0 karma start“%BASE_DIR%.. \ config \ karma.conf.js”%* 我也尝试导航到“\ AppData \ Roaming \ npm \ node_modules \ karma \ bin”,并看到了karma文件,当我试图运行它我再次得到: “业力”不被识别为内部或外部命令,可操作程序或batch file。 有什么build议么? 如果没有,请build议如何使用没有业障的茉莉花。 谢谢。

当我尝试运行testing时获取“不匹配的匿名define()模块…”

我想用requirejsconfiguration我的业力茉莉花unit testing。 但是,每次我运行它,我得到以下错误: Chrome 34.0.1847 (Mac OS X 10.9.2) ERROR Uncaught Error: Mismatched anonymous define() module: function (angular){ describe('Unit: Testing RequireJS', function(){ var ctrl; var scope; var rootScope; beforeEach(angular.mock.module('wsaApp')); beforeEach(angular.mock…<omitted>…ch 下面是differenr文件: spec文件: define(['angular'], function(angular){ describe('Unit: Testing RequireJS', function(){ var ctrl; var scope; var rootScope; beforeEach(angular.mock.module('wsaApp')); beforeEach(angular.mock.inject(function($rootScope){ scope = $rootScope.$new(); rootScope = $rootScope; })); }); }); […]