From 154a5e0ef89b4a95e6b3fcb844bc9b7fdbce3030 Mon Sep 17 00:00:00 2001 From: rasmi Date: Wed, 11 Mar 2026 20:45:55 -0400 Subject: [PATCH] [Tests] Fix resolve install in old npm version on CI --- tests/dep-time-travel.sh | 8 ++++++++ tests/src/core/importType.js | 1 + 2 files changed, 9 insertions(+) diff --git a/tests/dep-time-travel.sh b/tests/dep-time-travel.sh index 665ca1ccf1..f7a86d07f0 100755 --- a/tests/dep-time-travel.sh +++ b/tests/dep-time-travel.sh @@ -43,6 +43,14 @@ if [[ "$TRAVIS_NODE_VERSION" -lt "8" ]]; then npm i --no-save eslint-import-resolver-typescript@1.0.2 fi +# linklocal (pretest) symlinks the local resolver source, but old npm doesn't install its nested deps +if [[ "$TRAVIS_NODE_VERSION" -lt "10" ]]; then + for dir in resolvers/*/; do + echo "Installing dependencies for ${dir}..." + (cd "$dir" && npm install) + done +fi + if [ "${ESLINT_VERSION}" = '8' ]; then # This is a workaround for the crash in the initial processing of the ESLint class. echo "Installing self" diff --git a/tests/src/core/importType.js b/tests/src/core/importType.js index c497af5536..6fecd0fb89 100644 --- a/tests/src/core/importType.js +++ b/tests/src/core/importType.js @@ -82,6 +82,7 @@ describe('importType(name)', function () { }); it("should return 'internal' for aliased internal modules that look like core modules (webpack resolver)", function () { + this.timeout(10000); // initial load of the webpack resolver is slow on old Node + macOS CI const webpackConfig = { resolve: { modules: [pathToTestFiles, 'node_modules'] } }; const pathContext = testContext({ 'import/resolver': { webpack: { config: webpackConfig } } }); expect(importType('constants/index', pathContext)).to.equal('internal');