mirror of
https://github.com/actions/setup-node.git
synced 2025-07-31 05:43:47 +00:00
Merge 7f7a8815ae
into 49933ea528
This commit is contained in:
commit
a300359e24
12 changed files with 657 additions and 5 deletions
|
@ -2,7 +2,7 @@ Files located in data directory are used only for testing purposes.
|
|||
|
||||
|
||||
## Here the list of files in the data directory
|
||||
- `.nvmrc`, `.tools-versions` and `package.json` are used to test node-version-file logic
|
||||
- `.nvmrc`, `.tools-versions`, `package.json` and `.npmrc` are used to test node-version-file logic
|
||||
- `package-lock.json`, `pnpm-lock.yaml` and `yarn.lock` are used to test cache logic
|
||||
- `versions-manifest.json` is used for unit testing to check downloading Node.js versions from the node-versions repository.
|
||||
- `node-dist-index.json` is used for unit testing to check downloading Node.js versions from the official site. The file was constructed from https://nodejs.org/dist/index.json
|
||||
|
|
1
__tests__/data/.npmrc
Normal file
1
__tests__/data/.npmrc
Normal file
|
@ -0,0 +1 @@
|
|||
use-node-version=20.0.0
|
|
@ -103,10 +103,14 @@ describe('main tests', () => {
|
|||
${''} | ${''}
|
||||
${'unknown format'} | ${'unknown format'}
|
||||
${' 14.1.0 '} | ${'14.1.0'}
|
||||
${'use-node-version=lts/iron'} | ${'lts/iron'}
|
||||
${'use-node-version=23.10.0'} | ${'23.10.0'}
|
||||
${'{"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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue