serverless/test/unit/lib/utils/resolveCliInput.test.js
2020-11-30 16:53:52 +01:00

18 lines
662 B
JavaScript

'use strict';
const { expect } = require('chai');
const resolveCliInput = require('../../../../lib/utils/resolveCliInput');
describe('#resolveCliInput', () => {
it('Should crash on multiple config paths', () => {
expect(() => resolveCliInput('--config world --config hello')).to.throw(
/Expected single value/
);
expect(() => resolveCliInput('--config world --c hello')).to.throw(/Expected single value/);
expect(() => resolveCliInput('--c world --c hello')).to.throw(/Expected single value/);
});
it('Should resole singular config', () => {
expect(resolveCliInput('--config world').options.config).to.equal('world');
});
});