我的项目是ES6(webpack + babel).柏拉图是伟大的,但不与ES6工作还没有.我看了一下escomplex和一系列相关软件包,但看起来作者不再维护它了,似乎它不支持ES6.
我正在使用ESLint复杂性规则至少警告我是否存在问题(它设置为在6处发出警告),但它与漂亮的报告不同.
有什么建议?
我们已经建立了一个运行Karma的Jenkins CI服务器,目标是PhantomJS.我们正在通过Grunt运行我们的测试.Jenkins,Grunt和Phantom都运行正常,而Karma似乎开始很好,但是Karma无法捕获Phantom.我们的脚本在本地运行(OSX)就好了.通过bash或Jenkins运行相同的错误:
Running "karma:jenkins-unit" (karma) task
[2013-07-03 11:03:12.168] [WARN] config - urlRoot normalized to "/__karma/"
DEBUG [reporter]: Using reporter "dots".
DEBUG [reporter]: Using reporter "junit".
DEBUG [reporter]: Using reporter "coverage".
INFO [karma]: Karma server started at http://localhost:8084/__karma/
INFO [launcher]: Starting browser PhantomJS
DEBUG [launcher]: Creating temp dir at /tmp/testacular-7720703
DEBUG [launcher]: phantomjs /tmp/testacular-7720703/capture.js
INFO [karma]: To run via this server, use "karma run --runner-port 9104"
...
WARN [launcher]: PhantomJS have not captured in 60000 ms, killing.
DEBUG [launcher]: Process PhantomJS …Run Code Online (Sandbox Code Playgroud) centos node.js phantomjs socket-timeout-exception karma-runner
我有几个测试,我想在我的一个依赖项的块.then和.catch块上运行.
import test from 'ava';
import sinon from 'sinon';
// Fake dependency code - this would be imported
const myDependency = {
someMethod: () => {}
};
// Fake production code - this would be imported
function someCode() {
return myDependency.someMethod()
.then((response) => {
return response;
})
.catch((error) => {
throw error;
});
}
// Test code
let sandbox;
test.beforeEach(() => {
sandbox = sinon.sandbox.create();
});
test.afterEach.always(() => {
sandbox.restore();
});
test('First async test', async (t) …Run Code Online (Sandbox Code Playgroud) 按照记录在案的例子后,我无法通过gulp-watch或gulp-watch-less来解决问题.我最初的问题是lazypipe(这里没有显示),但在我看来,我在使用插件的方式上做错了.这是我愚蠢的代码仍然无法正常工作.
请注意,我尝试使用普通的gulp-watch,它表现出完全相同的问题:它不会在更改时触发后续管道.如果出现问题,我会在这里附上信息.
这是我的gulpfile.
var debug = require ( 'gulp-debug' );
var gulp = require ( 'gulp' );
var less = require ( 'gulp-less' );
var watchLess = require ( 'gulp-watch-less' );
gulp.task ( 'dev-watch', function () {
// main.less just imports child less files
gulp.src ( './app/styles/less/main.less' )
.pipe ( watchLess ( './app/styles/less/main.less' ) )
.pipe ( debug () );
.pipe ( less () )
.pipe ( gulp.dest ( './app/styles' ) )
;
});
Run Code Online (Sandbox Code Playgroud)
当我启动任务时,它会执行并完美地生成预期的文件.我看到调试输出流信息也很好.
当我更改文件时,我看到watchLess正在接受更改: …
async-await ×1
ava ×1
babeljs ×1
centos ×1
ecmascript-6 ×1
gulp ×1
gulp-less ×1
gulp-watch ×1
karma-runner ×1
node.js ×1
phantomjs ×1
plato ×1
sinon ×1
webpack ×1