diff --git a/.github/workflows/versions.yml b/.github/workflows/versions.yml index 8078deac..e0bf1ecc 100644 --- a/.github/workflows/versions.yml +++ b/.github/workflows/versions.yml @@ -159,7 +159,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] node-version-file: - [.nvmrc, .tool-versions, .tool-versions-node, package.json] + [.nvmrc, .tool-versions, .tool-versions-node, package.json, .npmrc] steps: - uses: actions/checkout@v4 - name: Setup node from node version file diff --git a/__tests__/data/.npmrc b/__tests__/data/.npmrc new file mode 100644 index 00000000..911d4fc2 --- /dev/null +++ b/__tests__/data/.npmrc @@ -0,0 +1 @@ +use-node-version=20.0.0 diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 501741a6..17537394 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -103,10 +103,13 @@ describe('main tests', () => { ${''} | ${''} ${'unknown format'} | ${'unknown format'} ${' 14.1.0 '} | ${'14.1.0'} + ${'use-node-version=lts/iron'} | ${'lts/iron'} ${'{"volta": {"node": ">=14.0.0 <=17.0.0"}}'}| ${'>=14.0.0 <=17.0.0'} ${'{"volta": {"extends": "./package.json"}}'}| ${'18.0.0'} ${'{"engines": {"node": "17.0.0"}}'} | ${'17.0.0'} ${'{}'} | ${null} + ${'[section]use-node-version=16'} | ${null} + ${'[section]\nuse-node-version=20'} | ${null} `.it('parses "$contents"', ({contents, expected}) => { const existsSpy = jest.spyOn(fs, 'existsSync'); existsSpy.mockImplementation(() => true);