update generated content

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-04-17 02:31:57 +02:00
parent 713d7298f6
commit dcd1f1fe0a
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
5 changed files with 7 additions and 8 deletions

@ -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;

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

2
dist/sourcemap-register.js generated vendored

File diff suppressed because one or more lines are too long