Merge pull request #82 from crazy-max/update-dev

chore: update dev dependencies
This commit is contained in:
CrazyMax 2023-03-26 21:31:01 +02:00 committed by GitHub
commit 2d105f7337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 1087 additions and 1416 deletions

View File

@ -59,7 +59,7 @@ describe('resolve', () => {
`, `,
null null
] ]
])('given %p config', async (val, file, exValue, error: Error) => { ])('given %p config', async (val: string, file: boolean, exValue: string, error: Error | null) => {
try { try {
const buildkit = new BuildKit(); const buildkit = new BuildKit();
let config: string; let config: string;

View File

@ -59,7 +59,7 @@ describe('hasLocalExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false false
], ],
[ [
@ -69,7 +69,7 @@ describe('hasLocalExporter', () => {
"target": "build" "target": "build"
}, },
} }
}, } as unknown as BakeDefinition,
false false
], ],
[ [
@ -81,7 +81,7 @@ describe('hasLocalExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true true
], ],
[ [
@ -93,7 +93,7 @@ describe('hasLocalExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false false
], ],
[ [
@ -105,7 +105,7 @@ describe('hasLocalExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false false
], ],
[ [
@ -117,7 +117,7 @@ describe('hasLocalExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true true
], ],
[ [
@ -129,7 +129,7 @@ describe('hasLocalExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true true
] ]
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => { ])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
@ -149,7 +149,7 @@ describe('hasTarExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false false
], ],
[ [
@ -161,7 +161,7 @@ describe('hasTarExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false false
], ],
[ [
@ -173,7 +173,7 @@ describe('hasTarExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false false
], ],
[ [
@ -185,7 +185,7 @@ describe('hasTarExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true true
], ],
[ [
@ -198,7 +198,7 @@ describe('hasTarExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true true
], ],
[ [
@ -210,7 +210,7 @@ describe('hasTarExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true true
], ],
[ [
@ -222,7 +222,7 @@ describe('hasTarExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false false
], ],
[ [
@ -234,7 +234,7 @@ describe('hasTarExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false false
], ],
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => { ])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
@ -254,7 +254,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false, false,
undefined undefined
], ],
@ -267,7 +267,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true, true,
undefined undefined
], ],
@ -281,7 +281,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true, true,
undefined undefined
], ],
@ -294,7 +294,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false, false,
undefined undefined
], ],
@ -307,7 +307,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false, false,
undefined undefined
], ],
@ -320,7 +320,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false, false,
undefined undefined
], ],
@ -334,7 +334,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true, true,
undefined undefined
], ],
@ -347,7 +347,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false, false,
undefined undefined
], ],
@ -360,7 +360,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false, false,
undefined undefined
], ],
@ -373,7 +373,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
false, false,
undefined undefined
], ],
@ -386,7 +386,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true, true,
false false
], ],
@ -399,7 +399,7 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true, true,
true true
], ],
@ -412,11 +412,11 @@ describe('hasDockerExporter', () => {
] ]
}, },
} }
}, } as unknown as BakeDefinition,
true, true,
true true
], ],
])('given %o and load:%p returns %p', async (def: BakeDefinition, expected: boolean, load: boolean) => { ])('given %o and load:%p returns %p', async (def: BakeDefinition, expected: boolean, load: boolean | undefined) => {
expect(Bake.hasDockerExporter(def, load)).toEqual(expected); expect(Bake.hasDockerExporter(def, load)).toEqual(expected);
}); });
}); });

View File

@ -162,7 +162,7 @@ describe('resolveBuildSecret', () => {
['=bbbbbbb', false, '', '', new Error('=bbbbbbb is not a valid secret')], ['=bbbbbbb', false, '', '', new Error('=bbbbbbb is not a valid secret')],
[`foo=${path.join(fixturesDir, 'secret.txt')}`, true, 'foo', 'bar', null], [`foo=${path.join(fixturesDir, 'secret.txt')}`, true, 'foo', 'bar', null],
[`notfound=secret`, true, '', '', new Error('secret file secret not found')] [`notfound=secret`, true, '', '', new Error('secret file secret not found')]
])('given %p key and %p secret', async (kvp: string, file: boolean, exKey: string, exValue: string, error: Error) => { ])('given %p key and %p secret', async (kvp: string, file: boolean, exKey: string, exValue: string, error: Error | null) => {
try { try {
let secret: string; let secret: string;
if (file) { if (file) {

View File

@ -69,7 +69,7 @@ describe('download', () => {
['linux', 's390x'], ['linux', 's390x'],
])( ])(
'acquires buildx for %s/%s', async (os, arch) => { 'acquires buildx for %s/%s', async (os, arch) => {
jest.spyOn(osm, 'platform').mockImplementation(() => os); jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
jest.spyOn(osm, 'arch').mockImplementation(() => arch); jest.spyOn(osm, 'arch').mockImplementation(() => arch);
const install = new Install(); const install = new Install();
const buildxBin = await install.download('latest'); const buildxBin = await install.download('latest');
@ -129,6 +129,6 @@ describe('getRelease', () => {
}); });
it('unknown release', async () => { it('unknown release', async () => {
await expect(Install.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Buildx release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json')); await expect(Install.getRelease('foo')).rejects.toThrow(new Error('Cannot find Buildx release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json'));
}); });
}); });

View File

@ -24,7 +24,7 @@ import {Docker} from '../../src/docker/docker';
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest'); const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest');
describe('install', () => { describe('install', () => {
jest.retryTimes(2); jest.retryTimes(2, {logErrorsBeforeRetry: true});
// prettier-ignore // prettier-ignore
test.each(['v23.0.0'])( test.each(['v23.0.0'])(
'install docker %s', async (version) => { 'install docker %s', async (version) => {

View File

@ -42,7 +42,7 @@ describe('download', () => {
['v20.10.22', 'win32'], ['v20.10.22', 'win32'],
])( ])(
'acquires %p of docker (%s)', async (version, platformOS) => { 'acquires %p of docker (%s)', async (version, platformOS) => {
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS); jest.spyOn(osm, 'platform').mockImplementation(() => platformOS as NodeJS.Platform);
const install = new Install({ const install = new Install({
version: version, version: version,
runDir: tmpDir, runDir: tmpDir,
@ -68,6 +68,6 @@ describe('getRelease', () => {
}); });
it('unknown release', async () => { it('unknown release', async () => {
await expect(Install.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Docker release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json')); await expect(Install.getRelease('foo')).rejects.toThrow(new Error('Cannot find Docker release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json'));
}); });
}); });

View File

@ -108,7 +108,7 @@ describe('actionsRuntimeToken', () => {
process.env.ACTIONS_RUNTIME_TOKEN = 'foo'; process.env.ACTIONS_RUNTIME_TOKEN = 'foo';
expect(() => { expect(() => {
GitHub.actionsRuntimeToken; GitHub.actionsRuntimeToken;
}).toThrowError(); }).toThrow();
}); });
it('fixture', async () => { it('fixture', async () => {
process.env.ACTIONS_RUNTIME_TOKEN = fs.readFileSync(path.join(__dirname, 'fixtures', 'runtimeToken.txt')).toString().trim(); process.env.ACTIONS_RUNTIME_TOKEN = fs.readFileSync(path.join(__dirname, 'fixtures', 'runtimeToken.txt')).toString().trim();
@ -131,11 +131,11 @@ describe('printActionsRuntimeTokenACs', () => {
}); });
it('empty', async () => { it('empty', async () => {
process.env.ACTIONS_RUNTIME_TOKEN = ''; process.env.ACTIONS_RUNTIME_TOKEN = '';
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrowError(new Error('ACTIONS_RUNTIME_TOKEN not set')); await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrow(new Error('ACTIONS_RUNTIME_TOKEN not set'));
}); });
it('malformed', async () => { it('malformed', async () => {
process.env.ACTIONS_RUNTIME_TOKEN = 'foo'; process.env.ACTIONS_RUNTIME_TOKEN = 'foo';
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrowError(new Error("Cannot parse GitHub Actions Runtime Token: Invalid token specified: Cannot read properties of undefined (reading 'replace')")); await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrow(new Error("Cannot parse GitHub Actions Runtime Token: Invalid token specified: Cannot read properties of undefined (reading 'replace')"));
}); });
it('refs/heads/master', async () => { it('refs/heads/master', async () => {
const infoSpy = jest.spyOn(core, 'info'); const infoSpy = jest.spyOn(core, 'info');

View File

@ -60,23 +60,23 @@
}, },
"devDependencies": { "devDependencies": {
"@types/csv-parse": "^1.2.2", "@types/csv-parse": "^1.2.2",
"@types/node": "^16.18.11", "@types/node": "^16.18.21",
"@types/semver": "^7.3.13", "@types/semver": "^7.3.13",
"@types/tmp": "^0.2.3", "@types/tmp": "^0.2.3",
"@typescript-eslint/eslint-plugin": "^5.49.0", "@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.49.0", "@typescript-eslint/parser": "^5.56.0",
"cpy-cli": "^4.2.0", "cpy-cli": "^4.2.0",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"eslint": "^8.33.0", "eslint": "^8.36.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5", "eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^26.9.0", "eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"jest": "^27.5.1", "jest": "^29.5.0",
"prettier": "^2.8.3", "prettier": "^2.8.7",
"rimraf": "^4.1.2", "rimraf": "^4.4.1",
"ts-jest": "^27.1.5", "ts-jest": "^29.0.5",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^4.9.4" "typescript": "^4.9.5"
} }
} }

2403
yarn.lock

File diff suppressed because it is too large Load Diff