Tag: karma runner

找不到模块“模块” – Rewire.js

我试图用我的Karma(Webpack + Typescript)unit testing来rewire使用rewire。 我的unit testing是用Typescript编写的,与Webpack捆绑在一起,然后与Karma一起运行。 我不断收到错误: PhantomJS 2.1.1 (Windows 7 0.0.0) ERROR Error: Cannot find module "module" at src/myTest.spec.ts:187 我研究了Rewire的代码,问题来自线路 var Module = require("module"), 我知道有一个Webpack Rewire插件,但是当我使用它时,我遇到了与已经报告过的问题相同的问题 。 我所有的testing,不使用rewire工作正常。 这是我的testing文件: import rewire = require("rewire"); const decorators = rewire("./decorators"); describe('something', () => { it('should do something', () => { decorators.__set__('Test', () => 'hello'); // In know […]

错误安装瞎猜

我遵循testatcular vide教程http://vojtajina.github.com/testacular/ 。 我安装了nodejs,当我试图安装testacular sudo npm install -g testacular我得到这个错误: npm http GET https://registry.npmjs.org/testacular npm http 304 https://registry.npmjs.org/testacular npm http GET https://registry.npmjs.org/chokidar npm http GET https://registry.npmjs.org/minimatch npm http GET https://registry.npmjs.org/socket.io npm http GET https://registry.npmjs.org/glob npm http GET https://registry.npmjs.org/optimist npm http 304 https://registry.npmjs.org/glob npm http 304 https://registry.npmjs.org/socket.io npm http 304 https://registry.npmjs.org/optimist npm http 304 https://registry.npmjs.org/chokidar npm http […]

安装业力testing运行器时出错

当我试图在Windows 7上安装karma ,我收到以下消息 MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visua l Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [C:\Users\user\AppData\Roaming\npm\node_modules\karma\ node_modules\socket.io\node_modules\socket.io-client\node_modules\ws\build\bind ing.sln] 我安装了.NET Framework 2.0 […]

无法安装NodeJS模块

我试图安装一个名为“karma-typescript-preprocessor”的NodeJS模块(请参阅: https : //npmjs.org/package/karma-typescript-preprocessor ),但是在尝试安装时出现错误。 Karma使用它在testing之前编译打字稿。 这是我得到的错误。 我该如何解决? C:\Users\Me\WebstormProjects\Core>npm install karma-typescript-preprocessor npm http GET https://registry.npmjs.org/karma-typescript-preprocessor npm http 304 https://registry.npmjs.org/karma-typescript-preprocessor npm ERR! Error: No compatible version found: karma-typescript-preprocessor@'>=0.1.0-0 <0.2.0-0' npm ERR! Valid install targets: npm ERR! ["0.0.2","0.0.4","0.0.5","0.0.6"] npm ERR! at installTargetsError (C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:719:10) npm ERR! at next (C:\Program Files (x86)\nodejs\node_modules\npm\lib\cache.js:698:17) npm ERR! at C:\Program Files […]

如何使用全球安装的Karma插件

我已经安装了一些karma插件,如:karma-requirejs,karma-jasmine …全局使用npm install -g 现在我想在业力testing执行中使用它们。 我发现使用它们的唯一方法是在karmaconfiguration的插件部分使用require函数: plugins: [ require('/usr/local/lib/node_modules/karma-requirejs'), require('/usr/local/lib/node_modules/karma-jasmine'), require('/usr/local/lib/node_modules/karma-junit-reporter'), require('/usr/local/lib/node_modules/karma-phantomjs-launcher'), require('/usr/local/lib/node_modules/karma-coverage'), require('/usr/local/lib/node_modules/karma-requirejs') ], 我以为业力会先看看本地的node_modules,然后看看全局的。 但是我必须设置完整path。 有没有办法使用全球安装的插件没有完整的path?

运行npm update时出错:找不到兼容版本:fsevents

我正在尝试安装一个运行Angular Karma的新的构build服务器,而且我遇到了问题。 当我运行npm更新时,出现以下错误: 381 error notarget No compatible version found: fsevents@'pipobscure/fsevents#7dcdf9fa3f8956610fd6f69f72c67bace2de7138' 381 error notarget Valid install targets: 381 error notarget ["0.1.1","0.1.3","0.1.4","0.1.5","0.1.6","0.2.0","0.3.0"] 381 error notarget 381 error notarget This is most likely not a problem with npm itself. 381 error notarget In most cases you or one of your dependencies are requesting 381 error notarget a […]

AngularJS:Karma + Jasmine用_real_后端进行testing

去运行Karma + Jasmine来testing带有真实后端的angularjs客户端。 由于Karma使用自己的express但我需要访问与DB和其他的东西真正的nodejs后端,我想添加拦截器到$httpProvider.interceptors ,只是将我的电话/api和redirect到真正的后端位置。 有没有更好的办法?

为angular – connect.static和karma安装node.js

我正在尝试按照apress在Pro AngularJS中的示例安装一个简单的节点Web服务器。 我已经安装了node.js和connect和karma模块。 当我通过“npm install -g karma”安装了karma时,我得到了一个警告,说“可选dep失败,继续”,但似乎安装正确。 我基于这个例子创build了一个server.js文件: var connect = require('connect'); connect.createServer( connect.static("../angularjs") ).listen(5000); 当我运行它我得到TypeError:Undefined不是一个函数指向connect.static。

Nodejs:peerDependencies错误,同时安装depedencNodejs

在我试图获得我需要的库,npm安装工作良好,直到一年左右,现在当我移动到一个新的服务器,它打破了PeerDependencies错误。 我有点困惑,因为我没有破解代码的原因,有没有人遇到过类似的问题,这可能不是因为旧版本的库被全球预先安装,因为我正在向全新的服务器迁移。 任何帮助在这里将非常感激。 错误 npm ERR! Linux 3.13.0-49-generic npm ERR! argv "node" "/usr/bin/npm" "install" npm ERR! node v0.10.37 npm ERR! npm v2.10.1 npm ERR! code EPEERINVALID npm ERR! peerinvalid The package karma does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer karma-requirejs@0.2.2 wants karma@>=0.9 npm ERR! peerinvalid Peer karma-mocha@0.1.10 wants karma@>=0.12.8 npm ERR! […]

如何解决错误:在运行Karma时产生Jenkins上的EACCES?

我已经设置了AWS Codepipeline。 该pipe道使用Git作为源,Jenkins进行testing,并使用EC2实例进行部署。 该项目是基于Angular Class的Angular Starter 。 因此,它使用Karma进行unit testing。 Jenkins服务在Ubuntu 16.04上运行。 Karma使用Headless Chrome进行testing。 问题是我目前在Jenkins上运行testing时遇到以下错误: [31m07 05 2017 14:30:35.779:ERROR [karma]: [39m{ Error: spawn EACCES at exports._errnoException (util.js:1050:11) at ChildProcess.spawn (internal/child_process.js:319:11) at exports.spawn (child_process.js:378:9) at spawnWithoutOutput (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:168:24) at Object.ProcessLauncher._execCommand (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:76:21) at Object.ProcessLauncher._start (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:33:10) at Object.<anonymous> (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/process.js:19:10) at emitOne (events.js:101:20) at Object.emit (events.js:191:7) at Object.BaseLauncher.start (/var/lib/jenkins/workspace/ExampleTask/node_modules/karma/lib/launchers/base.js:42:10) at Object.j […]