4
0
mirror of https://github.com/docker/setup-qemu-action.git synced 2026-03-05 07:02:03 +08:00

switch from jest to vitest

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2026-02-28 01:52:41 +01:00
parent 7e10951aea
commit 4fda753335
9 changed files with 1140 additions and 3096 deletions

View File

@@ -1,4 +1,4 @@
import {beforeEach, describe, expect, test} from '@jest/globals';
import {beforeEach, describe, expect, test} from 'vitest';
import * as context from '../src/context';
@@ -13,7 +13,7 @@ describe('getInputs', () => {
});
// prettier-ignore
test.each([
const cases: [number, Map<string, string>, context.Inputs][] = [
[
0,
new Map<string, string>([
@@ -23,7 +23,7 @@ describe('getInputs', () => {
image: 'docker.io/tonistiigi/binfmt:latest',
platforms: 'all',
cacheImage: true,
} as context.Inputs
}
],
[
1,
@@ -36,7 +36,7 @@ describe('getInputs', () => {
image: 'docker/binfmt:latest',
platforms: 'arm64,riscv64,arm',
cacheImage: false,
} as context.Inputs
}
],
[
2,
@@ -48,10 +48,11 @@ describe('getInputs', () => {
image: 'docker.io/tonistiigi/binfmt:latest',
platforms: 'arm64,riscv64,arm',
cacheImage: true,
} as context.Inputs
}
]
])(
'[%d] given %p as inputs, returns %p',
];
test.each(cases)(
'[%d] given %o as inputs, returns %o',
async (num: number, inputs: Map<string, string>, expected: context.Inputs) => {
inputs.forEach((value: string, name: string) => {
setInput(name, value);