mirror of
https://github.com/docker/actions-toolkit.git
synced 2024-11-23 11:36:10 +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({
|
const buildx = new Buildx({
|
||||||
standalone: false
|
standalone: false
|
||||||
});
|
});
|
||||||
await buildx.isAvailable();
|
buildx.isAvailable().catch(() => {
|
||||||
|
// noop
|
||||||
|
});
|
||||||
// eslint-disable-next-line jest/no-standalone-expect
|
// eslint-disable-next-line jest/no-standalone-expect
|
||||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['buildx'], {
|
expect(execSpy).toHaveBeenCalledWith(`docker`, ['buildx'], {
|
||||||
silent: true,
|
silent: true,
|
||||||
@ -130,7 +132,9 @@ describe('isAvailable', () => {
|
|||||||
const buildx = new Buildx({
|
const buildx = new Buildx({
|
||||||
standalone: true
|
standalone: true
|
||||||
});
|
});
|
||||||
await buildx.isAvailable();
|
buildx.isAvailable().catch(() => {
|
||||||
|
// noop
|
||||||
|
});
|
||||||
// eslint-disable-next-line jest/no-standalone-expect
|
// eslint-disable-next-line jest/no-standalone-expect
|
||||||
expect(execSpy).toHaveBeenCalledWith(`buildx`, [], {
|
expect(execSpy).toHaveBeenCalledWith(`buildx`, [], {
|
||||||
silent: true,
|
silent: true,
|
||||||
|
@ -11,7 +11,6 @@ describe('isAvailable', () => {
|
|||||||
it('cli', () => {
|
it('cli', () => {
|
||||||
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
const execSpy = jest.spyOn(exec, 'getExecOutput');
|
||||||
Docker.isAvailable();
|
Docker.isAvailable();
|
||||||
|
|
||||||
// eslint-disable-next-line jest/no-standalone-expect
|
// eslint-disable-next-line jest/no-standalone-expect
|
||||||
expect(execSpy).toHaveBeenCalledWith(`docker`, undefined, {
|
expect(execSpy).toHaveBeenCalledWith(`docker`, undefined, {
|
||||||
silent: true,
|
silent: true,
|
||||||
@ -23,14 +22,18 @@ describe('isAvailable', () => {
|
|||||||
describe('printVersion', () => {
|
describe('printVersion', () => {
|
||||||
it('docker cli', () => {
|
it('docker cli', () => {
|
||||||
const execSpy = jest.spyOn(exec, 'exec');
|
const execSpy = jest.spyOn(exec, 'exec');
|
||||||
Docker.printVersion(false);
|
Docker.printVersion(false).catch(() => {
|
||||||
|
// noop
|
||||||
|
});
|
||||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['version'], {
|
expect(execSpy).toHaveBeenCalledWith(`docker`, ['version'], {
|
||||||
failOnStdErr: false
|
failOnStdErr: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('standalone', () => {
|
it('standalone', () => {
|
||||||
const execSpy = jest.spyOn(exec, 'exec');
|
const execSpy = jest.spyOn(exec, 'exec');
|
||||||
Docker.printVersion(true);
|
Docker.printVersion(true).catch(() => {
|
||||||
|
// noop
|
||||||
|
});
|
||||||
expect(execSpy).not.toHaveBeenCalledWith(`docker`, ['version'], {
|
expect(execSpy).not.toHaveBeenCalledWith(`docker`, ['version'], {
|
||||||
failOnStdErr: false
|
failOnStdErr: false
|
||||||
});
|
});
|
||||||
@ -40,14 +43,18 @@ describe('printVersion', () => {
|
|||||||
describe('printInfo', () => {
|
describe('printInfo', () => {
|
||||||
it('docker cli', () => {
|
it('docker cli', () => {
|
||||||
const execSpy = jest.spyOn(exec, 'exec');
|
const execSpy = jest.spyOn(exec, 'exec');
|
||||||
Docker.printInfo(false);
|
Docker.printInfo(false).catch(() => {
|
||||||
|
// noop
|
||||||
|
});
|
||||||
expect(execSpy).toHaveBeenCalledWith(`docker`, ['info'], {
|
expect(execSpy).toHaveBeenCalledWith(`docker`, ['info'], {
|
||||||
failOnStdErr: false
|
failOnStdErr: false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('standalone', () => {
|
it('standalone', () => {
|
||||||
const execSpy = jest.spyOn(exec, 'exec');
|
const execSpy = jest.spyOn(exec, 'exec');
|
||||||
Docker.printInfo(true);
|
Docker.printInfo(true).catch(() => {
|
||||||
|
// noop
|
||||||
|
});
|
||||||
expect(execSpy).not.toHaveBeenCalledWith(`docker`, ['info'], {
|
expect(execSpy).not.toHaveBeenCalledWith(`docker`, ['info'], {
|
||||||
failOnStdErr: false
|
failOnStdErr: false
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,11 @@ beforeEach(() => {
|
|||||||
|
|
||||||
describe('git', () => {
|
describe('git', () => {
|
||||||
it('returns git remote ref', async () => {
|
it('returns git remote ref', async () => {
|
||||||
const ref: string = await git.getRemoteSha('https://github.com/docker/buildx.git', 'refs/pull/648/head');
|
try {
|
||||||
expect(ref).toEqual('f11797113e5a9b86bd976329c5dbb8a8bfdfadfa');
|
expect(await git.getRemoteSha('https://github.com/docker/buildx.git', 'refs/pull/648/head')).toEqual('f11797113e5a9b86bd976329c5dbb8a8bfdfadfa');
|
||||||
}, 100000);
|
} catch (e) {
|
||||||
|
// eslint-disable-next-line jest/no-conditional-expect
|
||||||
|
expect(e).toEqual(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user