Revert "update got dependency and convert to esm module (#533)"

This reverts commit 77efb36ae3.
This commit is contained in:
JM Faircloth 2024-04-15 14:55:47 -05:00
parent ee41aa2fcf
commit e64032b55d
39 changed files with 14350 additions and 12246 deletions

View file

@ -1,12 +1,11 @@
import { vi, describe, test, expect } from 'vitest';
jest.mock('@actions/core');
jest.mock('@actions/core/lib/command');
const core = require('@actions/core');
vi.mock('@actions/core');
import core from '@actions/core';
const got = require('got');
const { when } = require('jest-when');
import got from 'got';
import { when } from 'jest-when'
import { exportSecrets } from '../../src/action.js';
const { exportSecrets } = require('../../src/action');
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8200'}`;
const vaultToken = `${process.env.VAULT_TOKEN || 'testtoken'}`
@ -103,7 +102,7 @@ describe('authenticate with approle', () => {
});
beforeEach(() => {
vi.resetAllMocks();
jest.resetAllMocks();
when(core.getInput)
.calledWith('method', expect.anything())

View file

@ -1,12 +1,11 @@
import { vi, describe, test, expect } from 'vitest';
jest.mock('@actions/core');
jest.mock('@actions/core/lib/command');
const core = require('@actions/core');
vi.mock('@actions/core');
import core from '@actions/core';
const got = require('got');
const { when } = require('jest-when');
import got from 'got';
import { when } from 'jest-when'
import { exportSecrets } from '../../src/action.js';
const { exportSecrets } = require('../../src/action');
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8200'}`;
const vaultToken = `${process.env.VAULT_TOKEN || 'testtoken'}`
@ -108,7 +107,7 @@ describe('integration', () => {
});
beforeEach(() => {
vi.resetAllMocks();
jest.resetAllMocks();
when(core.getInput)
.calledWith('url', expect.anything())

View file

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

View file

@ -1,18 +1,17 @@
import { vi, describe, test, expect } from 'vitest';
vi.mock('@actions/core');
import core from '@actions/core';
import rsasign from 'jsrsasign';
import {
jest.mock('@actions/core');
jest.mock('@actions/core/lib/command');
const core = require('@actions/core');
const rsasign = require('jsrsasign');
const {
privateRsaKey,
privateRsaKeyBase64,
publicRsaKey
} from './rsa_keys.js';
} = require('./rsa_keys');
import got from 'got';
import { when } from 'jest-when'
const got = require('got');
const { when } = require('jest-when');
import { exportSecrets } from '../../src/action.js';
const { exportSecrets } = require('../../src/action');
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8200'}`;
const vaultToken = `${process.env.VAULT_TOKEN || 'testtoken'}`
@ -140,7 +139,7 @@ describe('jwt auth', () => {
describe('authenticate with private key', () => {
beforeEach(() => {
vi.resetAllMocks();
jest.resetAllMocks();
when(core.getInput)
.calledWith('url', expect.anything())
@ -190,7 +189,7 @@ describe('jwt auth', () => {
})
beforeEach(() => {
vi.resetAllMocks();
jest.resetAllMocks();
when(core.getInput)
.calledWith('url', expect.anything())

View file

@ -42,7 +42,7 @@ LrJEY9tZaRF8xraMZiOcBcyAt6S/TS29HttJ6+zlhcWx34fItEZ8jA5gzhTmspOY
-----END PUBLIC KEY-----
`;
export {
module.exports = {
privateRsaKey,
privateRsaKeyBase64,
publicRsaKey

View file

@ -1,12 +1,11 @@
import { vi, describe, test, expect } from 'vitest';
jest.mock('@actions/core');
jest.mock('@actions/core/lib/command');
const core = require('@actions/core');
vi.mock('@actions/core');
import core from '@actions/core';
const got = require('got');
const { when } = require('jest-when');
import got from 'got';
import { when } from 'jest-when'
import { exportSecrets } from '../../src/action.js';
const { exportSecrets } = require('../../src/action');
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8200'}`;
const vaultToken = `${process.env.VAULT_TOKEN || 'testtoken'}`
@ -85,7 +84,7 @@ describe('authenticate with userpass', () => {
});
beforeEach(() => {
vi.resetAllMocks();
jest.resetAllMocks();
when(core.getInput)
.calledWith('method', expect.anything())

View file

@ -1,11 +0,0 @@
import { defineConfig, configDefaults } from 'vitest/config'
export default defineConfig({
test: {
// required to make jest-when work with vitest
globals: true,
include: [
'**/integrationTests/basic/**.{test,spec}.?(c|m)[jt]s?(x)',
],
},
})

View file

@ -1,5 +1,3 @@
import { describe, test, expect } from 'vitest';
describe('e2e-tls', () => {
it('verify', () => {
expect(process.env.SECRET).toBe("SUPERSECRET");

View file

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

View file

@ -1,5 +1,5 @@
import got from 'got';
import core from '@actions/core';
const got = require('got');
const core = require('@actions/core');
const vaultUrl = `${process.env.VAULT_HOST}:${process.env.VAULT_PORT}`;
const caCertificateRaw = `${process.env.VAULTCA}`;

View file

@ -1,11 +0,0 @@
import { defineConfig, configDefaults } from 'vitest/config'
export default defineConfig({
test: {
// required to make jest-when work with vitest
globals: true,
include: [
'**/integrationTests/e2e-tls/**.{test,spec}.?(c|m)[jt]s?(x)',
],
},
})

View file

@ -1,5 +1,3 @@
import { describe, test, expect } from 'vitest';
describe('e2e', () => {
it('verify', () => {
expect(process.env.SECRET).toBe("SUPERSECRET");

View file

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

View file

@ -1,4 +1,4 @@
import got from 'got';
const got = require('got');
const vaultUrl = `${process.env.VAULT_HOST}:${process.env.VAULT_PORT}`;
const vaultToken = `${process.env.VAULT_TOKEN}` === undefined ? `${process.env.VAULT_TOKEN}` : "testtoken";

View file

@ -1,11 +0,0 @@
import { defineConfig, configDefaults } from 'vitest/config'
export default defineConfig({
test: {
// required to make jest-when work with vitest
globals: true,
include: [
'**/integrationTests/e2e/**.{test,spec}.?(c|m)[jt]s?(x)',
],
},
})

View file

@ -1,12 +1,11 @@
import { vi, describe, test, expect } from 'vitest';
jest.mock('@actions/core');
jest.mock('@actions/core/lib/command');
const core = require('@actions/core');
vi.mock('@actions/core');
import core from '@actions/core';
const got = require('got');
const { when } = require('jest-when');
import got from 'got';
import { when } from 'jest-when'
import { exportSecrets } from '../../src/action.js';
const { exportSecrets } = require('../../src/action');
const vaultUrl = `http://${process.env.VAULT_HOST || 'localhost'}:${process.env.VAULT_PORT || '8201'}`;
const vaultToken = `${process.env.VAULT_TOKEN || 'testtoken'}`
@ -42,7 +41,7 @@ describe('integration', () => {
});
beforeEach(() => {
vi.resetAllMocks();
jest.resetAllMocks();
when(core.getInput)
.calledWith('url', expect.anything())
@ -239,7 +238,7 @@ describe('authenticate with approle', () => {
});
beforeEach(() => {
vi.resetAllMocks();
jest.resetAllMocks();
when(core.getInput)
.calledWith('method', expect.anything())

View file

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

View file

@ -1,11 +0,0 @@
import { defineConfig, configDefaults } from 'vitest/config'
export default defineConfig({
test: {
// required to make jest-when work with vitest
globals: true,
include: [
'**/integrationTests/enterprise/**.{test,spec}.?(c|m)[jt]s?(x)',
],
},
})