mediacentral-sign
Version:
Signing tool for mediacentral cloud-ux apps
33 lines (25 loc) • 1.64 kB
JavaScript
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
const cliHelper = require('./cliHelper');
describe('cliHelper', () => {
beforeEach(() => {});
afterEach(() => {});
it('choseFunction', _asyncToGenerator(function* () {
const chosenOptionsSign = yield cliHelper.choseFunction('-S');
const chosenOptionsVerification = yield cliHelper.choseFunction('-V');
expect(chosenOptionsSign.Signature).toBeTruthy();
expect(chosenOptionsVerification.Verification).toBeTruthy();
}));
it('readArgs', _asyncToGenerator(function* () {
const args = yield cliHelper.readArgs('-k key_path -f file_path -p password -i AVID');
// Default manifest value
expect(args.manifest).toEqual('./manifest.json');
expect(args.id).toEqual('AVID');
expect(args.file).toEqual('file_path');
expect(args.key).toEqual('key_path');
}));
it('readArgsVerification', _asyncToGenerator(function* () {
const args = yield cliHelper.readArgsVerification('-m manifest_path -v public_key_path');
expect(args.manifest).toEqual('manifest_path');
expect(args.pubKeyPath).toEqual('public_key_path');
}));
});