describe('#addArgument()', () => { const ARGUMENT = 'PSCommand'; it('should add argument to the Shell', () => { const test = ps.addCommand(COMMAND) .then(() => ps.addArgument(ARGUMENT)); expect(test).to.eventually.be.an('array') .that.have.nested.property('[0].command', `${COMMAND} ${ARGUMENT}`); }); it('should fail adding argument to the Shell', () => { expect(ps.addArgument(ARGUMENT)).be.eventually.rejectedWith(PS_ARG_MISS_ERROR); }); });
describe('-> Get the status of a skill (and wait for changes to finish)', function() { var subject; beforeEach(function() { subject = smapiClient.skills.status(testData.skillId); }); it('responds with skill status', function() { subject = subject.then(waitOnSkill, retry); if (TEST_VERSION === VERSION_0) return expect(subject).to.eventually.have.nested.property('manifest.lastModified.status', SKILL_READY[TEST_VERSION]); else if (TEST_VERSION === VERSION_1) return expect(subject).to.eventually.have.nested.property('manifest.lastUpdateRequest.status', SKILL_READY[TEST_VERSION]); }); });
describe('#addParameter/s()', () => { const PARAMETER1 = {ForegroundColor: 'red'}; const PARAMETER2 = {name: 'BackgroundColor', value: 'white'}; it('should add parameter to the Shell', () => { const test = ps.addCommand(COMMAND) .then(() => ps.addParameter(PARAMETER1)) .then(() => ps.addParameter(PARAMETER2)); expect(test).to.eventually.be.an('array') .that.have.nested.property( '[0].command', `${COMMAND} -ForegroundColor red -BackgroundColor white` ); }); it('should add parameters to the Shell', () => { const test = ps.addCommand(COMMAND) .then(() => ps.addParameters([PARAMETER1, PARAMETER2])) expect(test).to.eventually.be.an('array') .that.have.nested.property( '[0].command', `${COMMAND} -ForegroundColor red -BackgroundColor white` ); }); it('should fail adding parameter to the Shell', () => { expect(ps.addParameter(PARAMETER1)).be.eventually.rejectedWith(PS_ARG_MISS_ERROR); expect(ps.addParameter(PARAMETER2)).be.eventually.rejectedWith(PS_ARG_MISS_ERROR); }); });
describe('-> Get the status of a skill (and wait for changes to finish)', function() { var subject; beforeEach(function() { subject = smapiClient.skills.status(testData.skillId); }); it('responds with skill status', function() { subject = subject.then(waitOnSkill, retry); if (TEST_VERSION === VERSION_0) return expect(subject).to.eventually.have.nested.property('manifest.lastModified.status', SKILL_READY[TEST_VERSION]); else if (TEST_VERSION === VERSION_1) return expect(subject).to.eventually.have.nested.property('manifest.lastUpdateRequest.status', SKILL_READY[TEST_VERSION]); }); });