mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-23 03:16:09 +08:00
noop on cmd call test
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
66653922b3
commit
b6f85576fa
@ -118,7 +118,9 @@ describe('isAvailable', () => {
|
||||
const buildx = new Buildx({
|
||||
standalone: false
|
||||
});
|
||||
await buildx.isAvailable();
|
||||
buildx.isAvailable().catch(() => {
|
||||
// noop
|
||||
});
|
||||
// eslint-disable-next-line jest/no-standalone-expect
|
||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['buildx'], {
|
||||
silent: true,
|
||||
@ -130,7 +132,9 @@ describe('isAvailable', () => {
|
||||
const buildx = new Buildx({
|
||||
standalone: true
|
||||
});
|
||||
await buildx.isAvailable();
|
||||
buildx.isAvailable().catch(() => {
|
||||
// noop
|
||||
});
|
||||
// eslint-disable-next-line jest/no-standalone-expect
|
||||
expect(execSpy).toHaveBeenCalledWith(`buildx`, [], {
|
||||
silent: true,
|
||||
|
@ -11,7 +11,6 @@ describe('isAvailable', () => {
|
||||
it('cli', () => {
|
||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
||||
Docker.isAvailable();
|
||||
|
||||
// eslint-disable-next-line jest/no-standalone-expect
|
||||
expect(execSpy).toHaveBeenCalledWith(`docker`, undefined, {
|
||||
silent: true,
|
||||
@ -23,14 +22,18 @@ describe('isAvailable', () => {
|
||||
describe('printVersion', () => {
|
||||
it('docker cli', () => {
|
||||
const execSpy = jest.spyOn(exec, 'exec');
|
||||
Docker.printVersion(false);
|
||||
Docker.printVersion(false).catch(() => {
|
||||
// noop
|
||||
});
|
||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['version'], {
|
||||
failOnStdErr: false
|
||||
});
|
||||
});
|
||||
it('standalone', () => {
|
||||
const execSpy = jest.spyOn(exec, 'exec');
|
||||
Docker.printVersion(true);
|
||||
Docker.printVersion(true).catch(() => {
|
||||
// noop
|
||||
});
|
||||
expect(execSpy).not.toHaveBeenCalledWith(`docker`, ['version'], {
|
||||
failOnStdErr: false
|
||||
});
|
||||
@ -40,14 +43,18 @@ describe('printVersion', () => {
|
||||
describe('printInfo', () => {
|
||||
it('docker cli', () => {
|
||||
const execSpy = jest.spyOn(exec, 'exec');
|
||||
Docker.printInfo(false);
|
||||
Docker.printInfo(false).catch(() => {
|
||||
// noop
|
||||
});
|
||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['info'], {
|
||||
failOnStdErr: false
|
||||
});
|
||||
});
|
||||
it('standalone', () => {
|
||||
const execSpy = jest.spyOn(exec, 'exec');
|
||||
Docker.printInfo(true);
|
||||
Docker.printInfo(true).catch(() => {
|
||||
// noop
|
||||
});
|
||||
expect(execSpy).not.toHaveBeenCalledWith(`docker`, ['info'], {
|
||||
failOnStdErr: false
|
||||
});
|
||||
|
@ -7,7 +7,11 @@ beforeEach(() => {
|
||||
|
||||
describe('git', () => {
|
||||
it('returns git remote ref', async () => {
|
||||
const ref: string = await git.getRemoteSha('https://github.com/docker/buildx.git', 'refs/pull/648/head');
|
||||
expect(ref).toEqual('f11797113e5a9b86bd976329c5dbb8a8bfdfadfa');
|
||||
}, 100000);
|
||||
try {
|
||||
expect(await git.getRemoteSha('https://github.com/docker/buildx.git', 'refs/pull/648/head')).toEqual('f11797113e5a9b86bd976329c5dbb8a8bfdfadfa');
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line jest/no-conditional-expect
|
||||
expect(e).toEqual(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user