it('returns true with a timestamp when a new category is created', async () => { const before = new Date().getTime(); const { created, modified, conflict } = await store.put('boris', '/documents/zipwire', 'image/poster', Buffer.from('vertibo'), null); const after = new Date().getTime(); expect(created).to.be.true; expect(parseInt(modified)).to.be.lte(after).and.gte(before); expect(!conflict).to.be.true; });
acc.devices[k].volumes.forEach(v => { expect(typeof v.name === 'string' || v.name === null).to.be.true; expect(v.mounted).to.be.true; expect(v.mountPoint).to.be.equal(k); expect(v.fs).to.be.a('string'); expect(v.space) .to.be.an('object') .that.has.all.keys('total', 'available', 'used'); expect(v.space.total) .to.be.a('number') .that.is.gte(0); expect(v.space.available) .to.be.a('number') .that.is.gte(0); expect(v.space.used) .to.be.a('number') .that.is.gte(0); });
acc.devices[input.DeviceID].volumes.forEach(v => { expect(typeof v.name === 'string' || v.name === null).to.be.true; expect(v.mounted).to.be.true; expect(v.mountPoint).to.be.equal(input.DeviceID); expect(v.fs).to.be.a('string'); expect(v.space) .to.be.an('object') .that.has.all.keys('total', 'available', 'used'); expect(v.space.total) .to.be.a('number') .that.is.gte(0); expect(v.space.available) .to.be.a('number') .that.is.gte(0); expect(v.space.used) .to.be.a('number') .that.is.gte(0); });
expect(devices[k].id).to.be.a('string'); expect(devices[k].node).to.be.a('string'); expect(devices[k].size).to.be.a('number').that.is.gte(0); expect(devices[k].volumes).to.be.an('array'); devices[k].volumes.forEach((v) => {
expect(devices[k].id).to.be.a('string'); expect(devices[k].node).to.be.a('string'); expect(devices[k].size).to.be.a('number').that.is.gte(0); expect(devices[k].volumes).to.be.an('array'); devices[k].volumes.forEach((v) => {
expect(devices[k].id).to.be.a('string'); expect(devices[k].node).to.be.a('string'); expect(devices[k].size).to.be.a('number').that.is.gte(0); expect(devices[k].volumes).to.be.an('array'); devices[k].volumes.forEach((v) => {
it('returns true with a timestamp when a new item is created', async () => { const before = new Date().getTime(); const { created, modified } = await store.put('boris', '/photos/antani', 'image/poster', Buffer.from('veribo'), null); const after = new Date().getTime(); expect(created).to.be.true; expect(parseInt(modified)).to.be.lte(after).and.gte(before); });
acc.devices[input.DeviceID].volumes.forEach(v => { expect(typeof v.name === 'string' || v.name === null).to.be.true; expect(v.mounted).to.be.true; expect(v.mountPoint).to.be.equal(input.DeviceID); expect(v.fs).to.be.a('string'); expect(v.space) .to.be.an('object') .that.has.all.keys('total', 'available', 'used'); expect(v.space.total) .to.be.a('number') .that.is.gte(0); expect(v.space.available) .to.be.a('number') .that.is.gte(0); expect(v.space.used) .to.be.a('number') .that.is.gte(0); });
acc.devices[k].volumes.forEach(v => { expect(typeof v.name === 'string' || v.name === null).to.be .true; expect(v.mounted).to.be.true; expect(v.mountPoint).to.be.equal(k); expect(v.fs).to.be.a('string'); expect(v.space) .to.be.an('object') .that.has.all.keys('total', 'available', 'used'); expect(v.space.total) .to.be.a('number') .that.is.gte(0); expect(v.space.available) .to.be.a('number') .that.is.gte(0); expect(v.space.used) .to.be.a('number') .that.is.gte(0); });