mirror of
https://github.com/docker/build-push-action.git
synced 2026-03-19 12:00:22 +08:00
switch to ESM and update config/test wiring
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
db4ff6ca90
commit
b66574c6d1
12 changed files with 105 additions and 662 deletions
|
|
@ -14,6 +14,7 @@ process.env = Object.assign({}, process.env, {
|
|||
});
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
type RequireCacheEntry = NonNullable<(typeof require.cache)[string]>;
|
||||
|
||||
const githubMock = {
|
||||
context: {
|
||||
|
|
@ -225,7 +226,7 @@ const githubMock = {
|
|||
vi.mock('@actions/github', () => githubMock);
|
||||
vi.doMock(require.resolve('@docker/actions-toolkit/node_modules/@actions/github'), () => githubMock);
|
||||
|
||||
for (const mod of ['@actions/github', '@docker/actions-toolkit/node_modules/@actions/github']) {
|
||||
for (const mod of ['@docker/actions-toolkit/node_modules/@actions/github']) {
|
||||
try {
|
||||
const resolved = require.resolve(mod);
|
||||
require.cache[resolved] = {
|
||||
|
|
@ -235,7 +236,7 @@ for (const mod of ['@actions/github', '@docker/actions-toolkit/node_modules/@act
|
|||
exports: githubMock,
|
||||
children: [],
|
||||
paths: []
|
||||
} as unknown as NodeModule;
|
||||
} as RequireCacheEntry;
|
||||
} catch {
|
||||
// Ignore unresolved optional paths; vi.mock handles module-level mocking.
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue