mirror of
https://gitee.com/actions-mirror/docker-login-action
synced 2024-11-23 20:30:41 +08:00
1c402b7c97
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
25 lines
680 B
TypeScript
25 lines
680 B
TypeScript
import osm = require('os');
|
|
|
|
import {getInputs} from '../src/context';
|
|
|
|
test('without username getInputs throws errors', async () => {
|
|
expect(() => {
|
|
getInputs();
|
|
}).toThrowError('Input required and not supplied: username');
|
|
});
|
|
|
|
test('without password getInputs throws errors', async () => {
|
|
process.env['INPUT_USERNAME'] = 'dbowie';
|
|
expect(() => {
|
|
getInputs();
|
|
}).toThrowError('Input required and not supplied: password');
|
|
});
|
|
|
|
test('with password and username getInputs does not error', async () => {
|
|
process.env['INPUT_USERNAME'] = 'dbowie';
|
|
process.env['INPUT_PASSWORD'] = 'groundcontrol';
|
|
expect(() => {
|
|
getInputs();
|
|
}).not.toThrowError();
|
|
});
|