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