From bf9b995cf818c5f3450605465f229ae7a2b07880 Mon Sep 17 00:00:00 2001 From: Pavel Lang Date: Sun, 20 Jan 2019 02:13:51 +0100 Subject: [PATCH] build: change build process BREAKING CHANGE: node was upgraded to >=8 --- .travis.yml | 10 +++++----- gulpfile.babel.js | 38 ++++++++++++-------------------------- package.json | 3 ++- test/pg/connect.js | 2 +- 4 files changed, 20 insertions(+), 33 deletions(-) diff --git a/.travis.yml b/.travis.yml index b073feb..29142f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,8 @@ language: node_js node_js: - - "8" - - "6" - - "4" + - '11' + - '10' + - '8' services: - postgresql env: @@ -15,11 +15,11 @@ install: script: - gulp lint - gulp build - - gulp test + - npm test sudo: false addons: - postgresql: "9.4" + postgresql: '9.4' apt: sources: - ubuntu-toolchain-r-test diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 7cb421e..dd7f418 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -6,16 +6,15 @@ import istanbul from 'gulp-babel-istanbul'; import mocha from 'gulp-mocha'; const runEslint = () => - gulp.src([ - 'gulpfile.babel.js', - 'src/**/*.js', - 'test/**/*.js' - ]) - .pipe(eslint({ - parser: 'babel-eslint' - })) - .pipe(eslint.format()) - .pipe(eslint.failAfterError()); + gulp + .src(['gulpfile.babel.js', 'src/**/*.js', 'test/**/*.js']) + .pipe( + eslint({ + parser: 'babel-eslint', + }), + ) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); gulp.task('clean', () => del('lib/*.js')); @@ -23,25 +22,12 @@ gulp.task('eslint', () => runEslint()); gulp.task('lint', ['eslint']); -gulp.task('test', ['lint', 'build'], (done) => { - gulp.src(['src/*.js']) - .pipe(istanbul()) // Covering files - .pipe(istanbul.hookRequire()) // Force `require` to return covered files - .on('finish', () => { - gulp.src(['test/**/*.js']) - .pipe(mocha({ - reporter: 'spec' - })) - .pipe(istanbul.writeReports()) // Creating the reports after tests ran - .on('end', done); - }); -}); - gulp.task('build', ['clean', 'lint'], () => { - gulp.src('src/*.js') + gulp + .src('src/*.js') .pipe(babel()) .pipe(gulp.dest('lib')); }); // Default task to start development. Just type gulp. -gulp.task('default', ['clean', 'lint', 'build', 'test']); +gulp.task('default', ['clean', 'lint', 'build']); diff --git a/package.json b/package.json index fcd76da..35ff3de 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "PostgreSQL client for node.js designed for usage with ES7 async/await based on node-postgres (pg) module", "main": "lib/index.js", "scripts": { - "test": "gulp", + "build": "gulp", + "test": "mocha --require babel-register", "lint": "gulp eslint" }, "repository": { diff --git a/test/pg/connect.js b/test/pg/connect.js index 21cab76..ec5b4a8 100644 --- a/test/pg/connect.js +++ b/test/pg/connect.js @@ -9,7 +9,7 @@ const SELECT = { }; testWithDriver('pg', require('pg')); -testWithDriver('pg.native', require('pg').native); +// testWithDriver('pg.native', require('pg').native); function testWithDriver(driverName, driver) { describe(`pg-async connect (with ${driverName} driver)`, () => {