Skip to content

Commit

Permalink
build: change build process
Browse files Browse the repository at this point in the history
BREAKING CHANGE: node was upgraded to >=8
  • Loading branch information
langpavel committed Jan 20, 2019
1 parent 8aac2e6 commit bf9b995
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 33 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- "8"
- "6"
- "4"
- '11'
- '10'
- '8'
services:
- postgresql
env:
Expand All @@ -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
Expand Down
38 changes: 12 additions & 26 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,28 @@ 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'));

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']);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion test/pg/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)`, () => {
Expand Down

0 comments on commit bf9b995

Please sign in to comment.