wip: replace jest with vitest

This commit is contained in:
JM Faircloth 2024-03-08 16:57:50 -06:00
parent b379e88781
commit fcac78057e
22 changed files with 2182 additions and 78 deletions

View file

@ -1,5 +1,7 @@
jest.mock('@actions/core');
jest.mock('@actions/core/lib/command');
import { vi, describe, test, expect } from 'vitest';
vi.mock('@actions/core');
vi.mock('@actions/core/lib/command');
import * as core from '@actions/core';
import got from 'got';
@ -41,7 +43,7 @@ describe('integration', () => {
});
beforeEach(() => {
jest.resetAllMocks();
vi.resetAllMocks();
when(core.getInput)
.calledWith('url', expect.anything())
@ -238,7 +240,7 @@ describe('authenticate with approle', () => {
});
beforeEach(() => {
jest.resetAllMocks();
vi.resetAllMocks();
when(core.getInput)
.calledWith('method', expect.anything())

View file

@ -1,3 +0,0 @@
module.exports = {
verbose: true
};

View file

@ -0,0 +1,8 @@
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
// required to make jest-when work with vitest
globals: true,
},
})