.with.property("_metrics") .which.is.an("array") .that.has.lengthOf(mockMetrics.length);
expect(value.data) .to.be.an("array") .that.has.lengthOf(1);
expect(eventLoop).to.have.property("series").that.has.keys("delay", "high"); }); });
describe('rule: allowNull', () => { const rules = { name: { type: 'string', allowNull: true } }; it('should return an object with property: null', (done) => { const response = whitelister.sync(rules, { name: null }); expect(response).to.be.an('object').that.has.property('name', null); done(); }); });
it('should throw an error by send an empty object', function() { expect(() => { validateShortcuts({}); }).to.throw(ExecutorError).that.has.property('code', code1); });
describe('hexa', function () { it('should return an object which has a string url property', async function () { this.timeout(60000) await Browser.init() const data = await Shortlink.parse('https%3A%2F%2Fhexafile.net%2Fu3CSw') expect(data).to.be.an('object') expect(data).to.has.property('url') expect(data.url).to.be.a('string') expect(data.url).to.include('zippyshare.com') }) })
it('should throw an error by configuration found on executor.json and package.json but without arguments', function() { process.chdir('test/docker/05'); expect(() => { buildCommand(); }).to.throw(ExecutorError).that.has.property('code', messages.errors.shortcut.withoutArguments.code); });
it('should return the default peer limits', function () { expect(limiter).to.be.a('object').that.has.property('peer').that.is.a('object'); expect(limiter.peer).to.have.property('delayAfter').to.eql(0); expect(limiter.peer).to.have.property('delayAfter').to.eql(0); expect(limiter.peer).to.have.property('delayMs').to.eql(0); expect(limiter.peer).to.have.property('max').to.eql(0); expect(limiter.peer).to.have.property('windowMs').to.eql(60000); });
it('should accept 88.8', (done) => { const rules = { amount: { type: 'float' } }; const params = { amount: 88.8 }; expect(whitelister(rules, params)).to.eventually.be.fulfilled .then((response) => { expect(response).to.be.an('object').that.has.property('amount', 88.8); done(); }); });
it('should throw an error by invalid arguments: 1 level', function() { expect(() => { validateShortcuts({ branchA: [] }); }).to.throw(ExecutorError).that.has.property('code').that.is.equal(code2); });
it('should throw an error by configuration not found, package.json without config', function() { process.chdir('test/docker/01'); expect(() => { buildCommand(); }).to.throw(ExecutorError).that.has.property('code', code404); expect(() => { buildCommand('a'); }).to.throw(ExecutorError).that.has.property('code', code404); });
it('should throw an error by configuration found on package.json even with an empty newExecutor.json', function() { process.chdir('test/docker/08'); expect(() => { buildCommand(); }).to.throw(ExecutorError).that.has.property('code', messages.errors.config.notConfigurationOnFile.code); });
describe('coeg', function () { it('should return an object which has a string url property', async function () { this.timeout(60000) await Browser.init() const data = await Shortlink.parse('http%3A%2F%2Fcoeg.in%2Fd5uuo') expect(data).to.be.an('object') expect(data).to.has.property('url') expect(data.url).to.be.a('string') expect(data.url).to.include('solidfiles.com') }) })
describe('rule: default', () => { it('should return an object with a default value', (done) => { const rules = { per_page: { type: 'integer', default: 20 } }; const response = whitelister.sync(rules, {}); expect(response).to.be.an('object').that.has.property('per_page', 20); done(); }); });
it('should throw an error by invalid arguments: 2 level', function() { expect(() => { validateShortcuts({ branchA: { branchAA: [] } }); }).to.throw(ExecutorError).that.has.property('code').that.is.equal(code2); });