update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>pull/470/head
parent
713d7298f6
commit
dcd1f1fe0a
|
@ -7,5 +7,5 @@ test('with password and username getInputs does not throw error', async () => {
|
||||||
process.env['INPUT_LOGOUT'] = 'true';
|
process.env['INPUT_LOGOUT'] = 'true';
|
||||||
expect(() => {
|
expect(() => {
|
||||||
getInputs();
|
getInputs();
|
||||||
}).not.toThrowError();
|
}).not.toThrow();
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,14 +8,14 @@ import * as stateHelper from '../src/state-helper';
|
||||||
test('errors without username and password', async () => {
|
test('errors without username and password', async () => {
|
||||||
jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
|
jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
|
||||||
process.env['INPUT_LOGOUT'] = 'true'; // default value
|
process.env['INPUT_LOGOUT'] = 'true'; // default value
|
||||||
await expect(main()).rejects.toThrowError(new Error('Username and password required'));
|
await expect(main()).rejects.toThrow(new Error('Username and password required'));
|
||||||
});
|
});
|
||||||
|
|
||||||
test('successful with username and password', async () => {
|
test('successful with username and password', async () => {
|
||||||
jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
|
jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
|
||||||
const setRegistrySpy = jest.spyOn(stateHelper, 'setRegistry');
|
const setRegistrySpy = jest.spyOn(stateHelper, 'setRegistry');
|
||||||
const setLogoutSpy = jest.spyOn(stateHelper, 'setLogout');
|
const setLogoutSpy = jest.spyOn(stateHelper, 'setLogout');
|
||||||
const dockerSpy = jest.spyOn(docker, 'login').mockImplementation(jest.fn());
|
const dockerSpy = jest.spyOn(docker, 'login').mockImplementation(() => Promise.resolve());
|
||||||
|
|
||||||
const username = 'dbowie';
|
const username = 'dbowie';
|
||||||
process.env[`INPUT_USERNAME`] = username;
|
process.env[`INPUT_USERNAME`] = username;
|
||||||
|
@ -40,8 +40,7 @@ test('calls docker login', async () => {
|
||||||
jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
|
jest.spyOn(osm, 'platform').mockImplementation(() => 'linux');
|
||||||
const setRegistrySpy = jest.spyOn(stateHelper, 'setRegistry');
|
const setRegistrySpy = jest.spyOn(stateHelper, 'setRegistry');
|
||||||
const setLogoutSpy = jest.spyOn(stateHelper, 'setLogout');
|
const setLogoutSpy = jest.spyOn(stateHelper, 'setLogout');
|
||||||
const dockerSpy = jest.spyOn(docker, 'login');
|
const dockerSpy = jest.spyOn(docker, 'login').mockImplementation(() => Promise.resolve());
|
||||||
dockerSpy.mockImplementation(jest.fn());
|
|
||||||
|
|
||||||
const username = 'dbowie';
|
const username = 'dbowie';
|
||||||
process.env[`INPUT_USERNAME`] = username;
|
process.env[`INPUT_USERNAME`] = username;
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue