2020-10-09 10:30:45 +00:00
|
|
|
import osm = require('os');
|
|
|
|
|
|
|
|
import {getInputs} from '../src/context';
|
|
|
|
|
2020-10-16 16:34:48 +00:00
|
|
|
test('without username getInputs throws errors', async () => {
|
|
|
|
expect(() => {
|
|
|
|
getInputs();
|
|
|
|
}).toThrowError('Input required and not supplied: username');
|
|
|
|
});
|
|
|
|
|
2020-10-09 10:30:45 +00:00
|
|
|
test('without password getInputs throws errors', async () => {
|
2020-10-16 16:34:48 +00:00
|
|
|
process.env['INPUT_USERNAME'] = 'dbowie';
|
2020-10-09 10:30:45 +00:00
|
|
|
expect(() => {
|
|
|
|
getInputs();
|
|
|
|
}).toThrowError('Input required and not supplied: password');
|
|
|
|
});
|
|
|
|
|
2020-10-16 16:34:48 +00:00
|
|
|
test('with password and username getInputs does not error', async () => {
|
|
|
|
process.env['INPUT_USERNAME'] = 'dbowie';
|
2020-10-09 10:30:45 +00:00
|
|
|
process.env['INPUT_PASSWORD'] = 'groundcontrol';
|
|
|
|
expect(() => {
|
|
|
|
getInputs();
|
|
|
|
}).not.toThrowError();
|
|
|
|
});
|