mirror of
https://github.com/hashicorp/vault-action.git
synced 2026-04-16 16:55:45 +00:00
fix test imports and vitest config
This commit is contained in:
parent
fcac78057e
commit
60c7f5af32
10 changed files with 45 additions and 12 deletions
|
|
@ -7,7 +7,7 @@ import * as core from '@actions/core';
|
|||
import got from 'got';
|
||||
import { when } from 'jest-when'
|
||||
|
||||
import exportSecrets from '../../src/action.js';
|
||||
import { exportSecrets } from '../../src/action.js';
|
||||
|
||||
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8200'}`;
|
||||
const vaultToken = `${process.env.VAULT_TOKEN || 'testtoken'}`
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import * as core from '@actions/core';
|
|||
import got from 'got';
|
||||
import { when } from 'jest-when'
|
||||
|
||||
import exportSecrets from '../../src/action.js';
|
||||
import { exportSecrets } from '../../src/action.js';
|
||||
|
||||
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8200'}`;
|
||||
const vaultToken = `${process.env.VAULT_TOKEN || 'testtoken'}`
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
import got from 'got';
|
||||
import { when } from 'jest-when'
|
||||
|
||||
import exportSecrets from '../../src/action.js';
|
||||
import { exportSecrets } from '../../src/action.js';
|
||||
|
||||
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8200'}`;
|
||||
const vaultToken = `${process.env.VAULT_TOKEN || 'testtoken'}`
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import * as core from '@actions/core';
|
|||
import got from 'got';
|
||||
import { when } from 'jest-when'
|
||||
|
||||
import exportSecrets from '../../src/action.js';
|
||||
import { exportSecrets } from '../../src/action.js';
|
||||
|
||||
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8200'}`;
|
||||
const vaultToken = `${process.env.VAULT_TOKEN || 'testtoken'}`
|
||||
|
|
@ -86,7 +86,7 @@ describe('authenticate with userpass', () => {
|
|||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
vi.resetAllMocks();
|
||||
|
||||
when(core.getInput)
|
||||
.calledWith('method', expect.anything())
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
import { defineConfig } from 'vitest/config'
|
||||
import { defineConfig, configDefaults } from 'vitest/config'
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
// required to make jest-when work with vitest
|
||||
globals: true,
|
||||
exclude:[
|
||||
...configDefaults.exclude,
|
||||
'./src/**',
|
||||
'**/integrationTests/e2e/**',
|
||||
'**/integrationTests/e2e-tls/**',
|
||||
'**/integrationTests/enterprise/**',
|
||||
],
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue