2
mirror of https://github.com/actions/setup-node.git synced 2026-08-14 02:41:30 +00:00

feat: add support for mise.toml file (#1421)

* feat: add support for mise.toml file

feat: add support for mise.toml file

feat: update licensed cache

feat: switch from js-toml to smol-toml to reduce deps and bundle size

* feat: added docs and improved tests

* feat: added docs and improved tests

* ci: fix ci

* ci: fix ci
This commit is contained in:
Gustavo Perdomo
2026-08-13 16:16:13 -04:00
committed by GitHub
parent 12b7ff3796
commit 1acbd4c02f
14 changed files with 2864 additions and 68 deletions
+12 -8
View File
@@ -1,16 +1,15 @@
import {
jest,
describe,
it,
expect,
beforeEach,
afterAll,
afterEach,
afterAll
beforeEach,
describe,
expect,
it,
jest
} from '@jest/globals';
import {fileURLToPath} from 'url';
import fs from 'fs';
import path from 'path';
import osm from 'os';
import {fileURLToPath} from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -197,6 +196,11 @@ describe('main tests', () => {
${'{"engines": {"node": "17.0.0"}}'} | ${'17.0.0'}
${'{"devEngines": {"runtime": {"name": "node", "version": "22.0.0"}}}'} | ${'22.0.0'}
${'{"devEngines": {"runtime": [{"name": "bun"}, {"name": "node", "version": "22.0.0"}]}}'} | ${'22.0.0'}
${'[tools]\ngo="latest"\nnode = "24.10"'} | ${'24.10'}
${'[tools]\nnode = "22.12"'} | ${'22.12'}
${'[tools]\ngo="latest"\nnode = "24.10"'} | ${'24.10'}
${'[tools]\nnode = { version = "22.20" }'} | ${'22.20'}
${'[tools]\nnode = { postinstall = "corepack enable" }'} | ${null}
`.it('parses "$contents"', ({contents, expected}: any) => {
const existsSpy = jest.spyOn(fs, 'existsSync');
existsSpy.mockImplementation(() => true);