mirror of
https://github.com/hashicorp/vault-action.git
synced 2026-04-10 14:10:09 +00:00
update got dependency and convert to esm module (#533)
* update require got to import got * convert remaining to esm * wip: replace jest with vitest * fix test imports and vitest config * remove dist package.json * fix import in ent test * add dist * move actions/core to prod dependency * remove unused import that was breaking esm compilation * simplify imports * use module.createRequire to import jsonata * add doc link comment * add comments on import insanity * add more comments * update PR tempalte * bump got and remove jest deps * revert debug npm run command * fix fs import * simplify vitest config for each test suite
This commit is contained in:
parent
a727ce205a
commit
77efb36ae3
39 changed files with 12213 additions and 14317 deletions
|
|
@ -1,17 +1,17 @@
|
|||
jest.mock('got');
|
||||
jest.mock('@actions/core');
|
||||
jest.mock('@actions/core/lib/command');
|
||||
import { vi, describe, test, expect } from 'vitest';
|
||||
|
||||
const command = require('@actions/core/lib/command');
|
||||
const core = require('@actions/core');
|
||||
const got = require('got');
|
||||
const {
|
||||
vi.mock('got');
|
||||
vi.mock('@actions/core');
|
||||
|
||||
import core from '@actions/core';
|
||||
import got from 'got';
|
||||
import {
|
||||
exportSecrets,
|
||||
parseSecretsInput,
|
||||
parseHeadersInput
|
||||
} = require('./action');
|
||||
} from './action.js';
|
||||
|
||||
const { when } = require('jest-when');
|
||||
import { when } from 'jest-when'
|
||||
|
||||
describe('parseSecretsInput', () => {
|
||||
it('parses simple secret', () => {
|
||||
|
|
@ -132,7 +132,7 @@ describe('parseHeaders', () => {
|
|||
|
||||
describe('exportSecrets', () => {
|
||||
beforeEach(() => {
|
||||
jest.resetAllMocks();
|
||||
vi.resetAllMocks();
|
||||
|
||||
when(core.getInput)
|
||||
.calledWith('url', expect.anything())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue