mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-23 03:16:09 +08:00
Merge pull request #82 from crazy-max/update-dev
chore: update dev dependencies
This commit is contained in:
commit
2d105f7337
@ -59,7 +59,7 @@ describe('resolve', () => {
|
||||
`,
|
||||
null
|
||||
]
|
||||
])('given %p config', async (val, file, exValue, error: Error) => {
|
||||
])('given %p config', async (val: string, file: boolean, exValue: string, error: Error | null) => {
|
||||
try {
|
||||
const buildkit = new BuildKit();
|
||||
let config: string;
|
||||
|
@ -59,7 +59,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@ -69,7 +69,7 @@ describe('hasLocalExporter', () => {
|
||||
"target": "build"
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@ -81,7 +81,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@ -93,7 +93,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@ -105,7 +105,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@ -117,7 +117,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@ -129,7 +129,7 @@ describe('hasLocalExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
]
|
||||
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
|
||||
@ -149,7 +149,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@ -161,7 +161,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@ -173,7 +173,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@ -185,7 +185,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@ -198,7 +198,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@ -210,7 +210,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true
|
||||
],
|
||||
[
|
||||
@ -222,7 +222,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
[
|
||||
@ -234,7 +234,7 @@ describe('hasTarExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false
|
||||
],
|
||||
])('given %o returns %p', async (def: BakeDefinition, expected: boolean) => {
|
||||
@ -254,7 +254,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@ -267,7 +267,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
undefined
|
||||
],
|
||||
@ -281,7 +281,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
undefined
|
||||
],
|
||||
@ -294,7 +294,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@ -307,7 +307,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@ -320,7 +320,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@ -334,7 +334,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
undefined
|
||||
],
|
||||
@ -347,7 +347,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@ -360,7 +360,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@ -373,7 +373,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
false,
|
||||
undefined
|
||||
],
|
||||
@ -386,7 +386,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
false
|
||||
],
|
||||
@ -399,7 +399,7 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
true
|
||||
],
|
||||
@ -412,11 +412,11 @@ describe('hasDockerExporter', () => {
|
||||
]
|
||||
},
|
||||
}
|
||||
},
|
||||
} as unknown as BakeDefinition,
|
||||
true,
|
||||
true
|
||||
],
|
||||
])('given %o and load:%p returns %p', async (def: BakeDefinition, expected: boolean, load: boolean) => {
|
||||
])('given %o and load:%p returns %p', async (def: BakeDefinition, expected: boolean, load: boolean | undefined) => {
|
||||
expect(Bake.hasDockerExporter(def, load)).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
@ -162,7 +162,7 @@ describe('resolveBuildSecret', () => {
|
||||
['=bbbbbbb', false, '', '', new Error('=bbbbbbb is not a valid secret')],
|
||||
[`foo=${path.join(fixturesDir, 'secret.txt')}`, true, 'foo', 'bar', null],
|
||||
[`notfound=secret`, true, '', '', new Error('secret file secret not found')]
|
||||
])('given %p key and %p secret', async (kvp: string, file: boolean, exKey: string, exValue: string, error: Error) => {
|
||||
])('given %p key and %p secret', async (kvp: string, file: boolean, exKey: string, exValue: string, error: Error | null) => {
|
||||
try {
|
||||
let secret: string;
|
||||
if (file) {
|
||||
|
@ -69,7 +69,7 @@ describe('download', () => {
|
||||
['linux', 's390x'],
|
||||
])(
|
||||
'acquires buildx for %s/%s', async (os, arch) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os);
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => os as NodeJS.Platform);
|
||||
jest.spyOn(osm, 'arch').mockImplementation(() => arch);
|
||||
const install = new Install();
|
||||
const buildxBin = await install.download('latest');
|
||||
@ -129,6 +129,6 @@ describe('getRelease', () => {
|
||||
});
|
||||
|
||||
it('unknown release', async () => {
|
||||
await expect(Install.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Buildx release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json'));
|
||||
await expect(Install.getRelease('foo')).rejects.toThrow(new Error('Cannot find Buildx release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json'));
|
||||
});
|
||||
});
|
||||
|
@ -24,7 +24,7 @@ import {Docker} from '../../src/docker/docker';
|
||||
const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest');
|
||||
|
||||
describe('install', () => {
|
||||
jest.retryTimes(2);
|
||||
jest.retryTimes(2, {logErrorsBeforeRetry: true});
|
||||
// prettier-ignore
|
||||
test.each(['v23.0.0'])(
|
||||
'install docker %s', async (version) => {
|
||||
|
@ -42,7 +42,7 @@ describe('download', () => {
|
||||
['v20.10.22', 'win32'],
|
||||
])(
|
||||
'acquires %p of docker (%s)', async (version, platformOS) => {
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS);
|
||||
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS as NodeJS.Platform);
|
||||
const install = new Install({
|
||||
version: version,
|
||||
runDir: tmpDir,
|
||||
@ -68,6 +68,6 @@ describe('getRelease', () => {
|
||||
});
|
||||
|
||||
it('unknown release', async () => {
|
||||
await expect(Install.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Docker release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json'));
|
||||
await expect(Install.getRelease('foo')).rejects.toThrow(new Error('Cannot find Docker release foo in https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/docker-releases.json'));
|
||||
});
|
||||
});
|
||||
|
@ -108,7 +108,7 @@ describe('actionsRuntimeToken', () => {
|
||||
process.env.ACTIONS_RUNTIME_TOKEN = 'foo';
|
||||
expect(() => {
|
||||
GitHub.actionsRuntimeToken;
|
||||
}).toThrowError();
|
||||
}).toThrow();
|
||||
});
|
||||
it('fixture', async () => {
|
||||
process.env.ACTIONS_RUNTIME_TOKEN = fs.readFileSync(path.join(__dirname, 'fixtures', 'runtimeToken.txt')).toString().trim();
|
||||
@ -131,11 +131,11 @@ describe('printActionsRuntimeTokenACs', () => {
|
||||
});
|
||||
it('empty', async () => {
|
||||
process.env.ACTIONS_RUNTIME_TOKEN = '';
|
||||
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrowError(new Error('ACTIONS_RUNTIME_TOKEN not set'));
|
||||
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrow(new Error('ACTIONS_RUNTIME_TOKEN not set'));
|
||||
});
|
||||
it('malformed', async () => {
|
||||
process.env.ACTIONS_RUNTIME_TOKEN = 'foo';
|
||||
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrowError(new Error("Cannot parse GitHub Actions Runtime Token: Invalid token specified: Cannot read properties of undefined (reading 'replace')"));
|
||||
await expect(GitHub.printActionsRuntimeTokenACs()).rejects.toThrow(new Error("Cannot parse GitHub Actions Runtime Token: Invalid token specified: Cannot read properties of undefined (reading 'replace')"));
|
||||
});
|
||||
it('refs/heads/master', async () => {
|
||||
const infoSpy = jest.spyOn(core, 'info');
|
||||
|
22
package.json
22
package.json
@ -60,23 +60,23 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/csv-parse": "^1.2.2",
|
||||
"@types/node": "^16.18.11",
|
||||
"@types/node": "^16.18.21",
|
||||
"@types/semver": "^7.3.13",
|
||||
"@types/tmp": "^0.2.3",
|
||||
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
||||
"@typescript-eslint/parser": "^5.49.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
||||
"@typescript-eslint/parser": "^5.56.0",
|
||||
"cpy-cli": "^4.2.0",
|
||||
"dotenv": "^16.0.3",
|
||||
"eslint": "^8.33.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint": "^8.36.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-jest": "^26.9.0",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.8.3",
|
||||
"rimraf": "^4.1.2",
|
||||
"ts-jest": "^27.1.5",
|
||||
"jest": "^29.5.0",
|
||||
"prettier": "^2.8.7",
|
||||
"rimraf": "^4.4.1",
|
||||
"ts-jest": "^29.0.5",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.4"
|
||||
"typescript": "^4.9.5"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user