diff --git a/integrationTests/basic/approle_auth.test.js b/integrationTests/basic/approle_auth.test.js index bcfdfc8..e09f1fd 100644 --- a/integrationTests/basic/approle_auth.test.js +++ b/integrationTests/basic/approle_auth.test.js @@ -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'}` diff --git a/integrationTests/basic/integration.test.js b/integrationTests/basic/integration.test.js index 15935f8..bd16609 100644 --- a/integrationTests/basic/integration.test.js +++ b/integrationTests/basic/integration.test.js @@ -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'}` diff --git a/integrationTests/basic/jwt_auth.test.js b/integrationTests/basic/jwt_auth.test.js index 8f10e21..ec6eeb6 100644 --- a/integrationTests/basic/jwt_auth.test.js +++ b/integrationTests/basic/jwt_auth.test.js @@ -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'}` diff --git a/integrationTests/basic/userpass_auth.test.js b/integrationTests/basic/userpass_auth.test.js index 40f465b..6479862 100644 --- a/integrationTests/basic/userpass_auth.test.js +++ b/integrationTests/basic/userpass_auth.test.js @@ -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()) diff --git a/integrationTests/basic/vitest.config.js b/integrationTests/basic/vitest.config.js index 511b61a..8f2a9d8 100644 --- a/integrationTests/basic/vitest.config.js +++ b/integrationTests/basic/vitest.config.js @@ -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/**', + ], }, }) diff --git a/integrationTests/e2e-tls/jest.config.js b/integrationTests/e2e-tls/jest.config.js deleted file mode 100644 index 03d15be..0000000 --- a/integrationTests/e2e-tls/jest.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - verbose: true -}; diff --git a/integrationTests/e2e-tls/vitest.config.js b/integrationTests/e2e-tls/vitest.config.js new file mode 100644 index 0000000..d0625bb --- /dev/null +++ b/integrationTests/e2e-tls/vitest.config.js @@ -0,0 +1,15 @@ +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/basic/**', + '**/integrationTests/e2e/**', + '**/integrationTests/enterprise/**', + ], + }, +}) diff --git a/integrationTests/e2e/vitest.config.js b/integrationTests/e2e/vitest.config.js index 511b61a..6f903b0 100644 --- a/integrationTests/e2e/vitest.config.js +++ b/integrationTests/e2e/vitest.config.js @@ -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/basic/**', + '**/integrationTests/e2e-tls/**', + '**/integrationTests/enterprise/**', + ], }, }) diff --git a/integrationTests/enterprise/vitest.config.js b/integrationTests/enterprise/vitest.config.js index 511b61a..5d22281 100644 --- a/integrationTests/enterprise/vitest.config.js +++ b/integrationTests/enterprise/vitest.config.js @@ -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/basic/**', + '**/integrationTests/e2e/**', + '**/integrationTests/e2e-tls/**', + ], }, }) diff --git a/src/secrets.js b/src/secrets.js index 53766ba..be353b8 100644 --- a/src/secrets.js +++ b/src/secrets.js @@ -44,7 +44,7 @@ async function getSecrets(secretRequests, client, ignoreNotFound) { } catch (error) { const {response} = error; if (response?.statusCode === 404) { - notFoundMsg = `Unable to retrieve result for "${path}" because it was not found: ${response.body.trim()}`; + let notFoundMsg = `Unable to retrieve result for "${path}" because it was not found: ${response.body.trim()}`; const ignoreNotFound = (core.getInput('ignoreNotFound', { required: false }) || 'false').toLowerCase() != 'false'; if (ignoreNotFound) { core.error(`✘ ${notFoundMsg}`);