diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 3b07263..4dfe192 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -31,8 +31,8 @@ jobs: strategy: fail-fast: false matrix: - node: [10, 12, 14, 16] - os: [ubuntu-latest, windows-latest, macos-latest] + node: [10, 12, 14, 16, 18, 20, 22, 24] + os: [ubuntu-latest, windows-latest, macos-13] steps: - name: Clone repository diff --git a/lib/find_config.js b/lib/find_config.js index fe1ad95..ab80b2e 100644 --- a/lib/find_config.js +++ b/lib/find_config.js @@ -20,7 +20,8 @@ module.exports = function (opts) { configPath = fileSearch(configNameSearch, searchPaths); } // confirm the configPath exists and return an absolute path to it - if (fs.existsSync(configPath)) { + // Skip the call to fs.existsSync if configPath is null + if (configPath && fs.existsSync(configPath)) { return path.resolve(configPath); } return null; diff --git a/test/index.js b/test/index.js index a0799e6..b861838 100644 --- a/test/index.js +++ b/test/index.js @@ -3,7 +3,6 @@ var Module = require('module'); var exec = require('child_process').exec; var expect = require('expect'); -var sinon = require('sinon'); var resolve = require('resolve'); var Liftoff = require('../'); @@ -62,6 +61,13 @@ describe('Liftoff', function () { describe('buildEnvironment', function () { it('should locate local module using cwd if no config is found', function (done) { + if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) { + this.skip(); + return; + } + + var sinon = require('sinon'); + var test = new Liftoff({ name: 'chai' }); var cwd = 'explicit/cwd'; var spy = sinon.spy(resolve, 'sync'); @@ -79,6 +85,13 @@ describe('Liftoff', function () { }); it('should locate global module using NODE_PATH if defined', function (done) { + if (process.versions.node.startsWith("10.") || process.versions.node.startsWith("12.")) { + this.skip(); + return; + } + + var sinon = require('sinon'); + var test = new Liftoff({ name: 'dummy' }); var cwd = 'explicit/cwd'; var spy = sinon.spy(resolve, 'sync');