mirror of
https://github.com/hashicorp/vault-action.git
synced 2026-04-16 08:45:44 +00:00
wip: replace jest with vitest
This commit is contained in:
parent
b379e88781
commit
fcac78057e
22 changed files with 2182 additions and 78 deletions
|
|
@ -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';
|
||||
|
|
@ -102,7 +104,7 @@ describe('authenticate with approle', () => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
vi.resetAllMocks();
|
||||
|
||||
when(core.getInput)
|
||||
.calledWith('method', expect.anything())
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
@ -107,7 +109,7 @@ describe('integration', () => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
vi.resetAllMocks();
|
||||
|
||||
when(core.getInput)
|
||||
.calledWith('url', expect.anything())
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
module.exports = {
|
||||
verbose: true
|
||||
};
|
||||
|
|
@ -1,12 +1,14 @@
|
|||
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 rsasign from 'jsrsasign';
|
||||
import {
|
||||
privateRsaKey,
|
||||
privateRsaKeyBase64,
|
||||
publicRsaKey
|
||||
} from './rsa_keys.js');
|
||||
} from './rsa_keys.js';
|
||||
|
||||
import got from 'got';
|
||||
import { when } from 'jest-when'
|
||||
|
|
@ -139,7 +141,7 @@ describe('jwt auth', () => {
|
|||
|
||||
describe('authenticate with private key', () => {
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
vi.resetAllMocks();
|
||||
|
||||
when(core.getInput)
|
||||
.calledWith('url', expect.anything())
|
||||
|
|
@ -189,7 +191,7 @@ describe('jwt auth', () => {
|
|||
})
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
vi.resetAllMocks();
|
||||
|
||||
when(core.getInput)
|
||||
.calledWith('url', expect.anything())
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
|
|||
8
integrationTests/basic/vitest.config.js
Normal file
8
integrationTests/basic/vitest.config.js
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
// required to make jest-when work with vitest
|
||||
globals: true,
|
||||
},
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue