1
0
Fork 0
mirror of https://github.com/docker/login-action.git synced 2025-06-08 13:41:48 +02:00

Add context tests

This commit is contained in:
Bryan Clark 2020-10-07 22:31:05 -07:00
parent b4915282a8
commit f3c2e45637
3 changed files with 21 additions and 5 deletions

16
__tests__/context.test.ts Normal file
View file

@ -0,0 +1,16 @@
import osm = require('os');
import {getInputs} from '../src/context';
test('without password getInputs throws errors', async () => {
expect(() => {
getInputs();
}).toThrowError('Input required and not supplied: password');
});
test('with password getInputs does not error', async () => {
process.env['INPUT_PASSWORD'] = 'groundcontrol';
expect(() => {
getInputs();
}).not.toThrowError();
});