Make grpc-js tests run on Node 8.11.2

This commit is contained in:
murgatroid99 2018-05-30 15:57:35 -07:00
parent 14cf37fdd9
commit aa9d47da14
2 changed files with 5 additions and 3 deletions

View File

@ -72,10 +72,12 @@ gulp.task('copy-test-fixtures', 'Copy test fixtures.', () => {
* Transpiles src/ and test/, and then runs all tests. * Transpiles src/ and test/, and then runs all tests.
*/ */
gulp.task('test', 'Runs all tests.', ['copy-test-fixtures'], () => { 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`) return gulp.src(`${outDir}/test/**/*.js`)
.pipe(mocha({reporter: 'mocha-jenkins-reporter'})); .pipe(mocha({reporter: 'mocha-jenkins-reporter',
require: ['ts-node/register']}));
} else { } else {
console.log(`Skipping grpc-js tests for Node ${process.version}`); console.log(`Skipping grpc-js tests for Node ${process.version}`);
return Promise.resolve(null);
} }
}); });

View File

@ -57,7 +57,7 @@ gulp.task('test', 'Run API-level tests', () => {
.on('error', reject); .on('error', reject);
}); });
var runTestsArgPairs; var runTestsArgPairs;
if (semver.satisfies(process.version, '>=9.4')) { if (semver.satisfies(process.version, '^ 8.11.2 || >=9.4')) {
runTestsArgPairs = [ runTestsArgPairs = [
['native', 'native'], ['native', 'native'],
['native', 'js'], ['native', 'js'],