mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Fix #531: Submit code coverage to coveralls.io
This commit is contained in:
@@ -13,3 +13,6 @@ npm-debug.log
|
||||
.env
|
||||
build/
|
||||
.vscode/
|
||||
|
||||
# Directories needed for code coverage
|
||||
/coverage/
|
||||
|
||||
@@ -16,3 +16,4 @@ addons:
|
||||
notifications:
|
||||
email: false
|
||||
script: npm run $NPM_COMMAND
|
||||
after_success: npm run coveralls
|
||||
|
||||
+20
-1
@@ -1,7 +1,9 @@
|
||||
const browserify = require('browserify');
|
||||
const buffer = require('vinyl-buffer');
|
||||
const coveralls = require('gulp-coveralls');
|
||||
const fs = require('fs-extra');
|
||||
const gulp = require('gulp');
|
||||
const istanbul = require('gulp-istanbul');
|
||||
const merge = require('merge-stream');
|
||||
const mocha = require('gulp-mocha');
|
||||
const mochaPhantomJs = require('gulp-mocha-phantomjs');
|
||||
@@ -70,9 +72,18 @@ gulp.task('browserify', ['tsc'], function() {
|
||||
return merge(bundleStream, copyAddons, copyStylesheets);
|
||||
});
|
||||
|
||||
gulp.task('test-mocha', function () {
|
||||
gulp.task('instrument-test', function () {
|
||||
return gulp.src(['lib/**/*.js'])
|
||||
// Covering files
|
||||
.pipe(istanbul())
|
||||
// Force `require` to return covered files
|
||||
.pipe(istanbul.hookRequire());
|
||||
});
|
||||
|
||||
gulp.task('test-mocha', ['instrument-test'], function () {
|
||||
return gulp.src(['lib/*test.js', 'lib/**/*test.js'], {read: false})
|
||||
.pipe(mocha())
|
||||
.pipe(istanbul.writeReports());
|
||||
});
|
||||
|
||||
gulp.task('test-mocha-phantomjs', function () {
|
||||
@@ -91,6 +102,14 @@ gulp.task('sorcery', ['browserify'], function () {
|
||||
chain.writeSync();
|
||||
});
|
||||
|
||||
/**
|
||||
* Submit coverage results to coveralls.io
|
||||
*/
|
||||
gulp.task('coveralls', function () {
|
||||
gulp.src('coverage/**/lcov.info')
|
||||
.pipe(coveralls());
|
||||
});
|
||||
|
||||
gulp.task('build', ['sorcery']);
|
||||
gulp.task('test', ['test-mocha', 'test-mocha-phantomjs']);
|
||||
gulp.task('default', ['build']);
|
||||
|
||||
+4
-1
@@ -47,6 +47,8 @@
|
||||
"glob": "^7.0.5",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-cli": "^1.2.2",
|
||||
"gulp-coveralls": "^0.1.4",
|
||||
"gulp-istanbul": "^1.1.1",
|
||||
"gulp-mocha": "^3.0.1",
|
||||
"gulp-mocha-phantomjs": "^0.12.0",
|
||||
"gulp-sourcemaps": "1.9.1",
|
||||
@@ -70,6 +72,7 @@
|
||||
"test": "gulp test",
|
||||
"build:docs": "jsdoc -c jsdoc.json",
|
||||
"build": "gulp build",
|
||||
"prepublish": "npm run build"
|
||||
"prepublish": "npm run build",
|
||||
"coveralls": "gulp coveralls"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -550,6 +550,7 @@ describe('xterm.js', function() {
|
||||
|
||||
describe('unicode - surrogates', function() {
|
||||
it('2 characters per cell', function () {
|
||||
this.timeout(10000); // This is needed because istanbul patches code and slows it down
|
||||
var high = String.fromCharCode(0xD800);
|
||||
for (var i=0xDC00; i<=0xDCFF; ++i) {
|
||||
xterm.write(high + String.fromCharCode(i));
|
||||
|
||||
Reference in New Issue
Block a user