From aa9d47da140dbe6aacb9695132ec039976723781 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 30 May 2018 15:57:35 -0700 Subject: [PATCH] Make grpc-js tests run on Node 8.11.2 --- packages/grpc-js-core/gulpfile.ts | 6 ++++-- test/gulpfile.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/grpc-js-core/gulpfile.ts b/packages/grpc-js-core/gulpfile.ts index fcce74cd..b75350cc 100644 --- a/packages/grpc-js-core/gulpfile.ts +++ b/packages/grpc-js-core/gulpfile.ts @@ -72,10 +72,12 @@ gulp.task('copy-test-fixtures', 'Copy test fixtures.', () => { * Transpiles src/ and test/, and then runs all tests. */ gulp.task('test', 'Runs all tests.', ['copy-test-fixtures'], () => { - if (semver.satisfies(process.version, '>=9.4')) { + if (semver.satisfies(process.version, '^8.11.2 || >=9.4')) { return gulp.src(`${outDir}/test/**/*.js`) - .pipe(mocha({reporter: 'mocha-jenkins-reporter'})); + .pipe(mocha({reporter: 'mocha-jenkins-reporter', + require: ['ts-node/register']})); } else { console.log(`Skipping grpc-js tests for Node ${process.version}`); + return Promise.resolve(null); } }); diff --git a/test/gulpfile.js b/test/gulpfile.js index 2aa1c9c2..42ff04f0 100644 --- a/test/gulpfile.js +++ b/test/gulpfile.js @@ -57,7 +57,7 @@ gulp.task('test', 'Run API-level tests', () => { .on('error', reject); }); var runTestsArgPairs; - if (semver.satisfies(process.version, '>=9.4')) { + if (semver.satisfies(process.version, '^ 8.11.2 || >=9.4')) { runTestsArgPairs = [ ['native', 'native'], ['native', 'js'],