/* eslint-disable */ describe('is', function () { it('is', function (done) { let store = window.cenote() .set({ name: 'foo' }) if (!store.is('name')) { return done('!store.is(\'name\')') } return done() }) it('is not', function (done) { let store = window.cenote() .set({ name: 'foo' }) if (!store.is.not('test')) { return done('store.isNot(\'test\')') } if (store.is.not('name')) { return done('store.isNot(\'name\')') } return done() }) it('is undefined', function (done) { let store = window.cenote() .set({ name: undefined, foo: true }) if (!store.is.undefined('name')) { return done('!store.is.undefiend(\'name\')') } if (store.is.undefined('foo')) { return done('store.is.undefiend(\'foo\')') } return done() }) it('is not undefined', function (done) { let store = window.cenote() .set({ name: undefined, foo: true }) if (store.is.not.undefined('name')) { return done('!store.is.undefiend(\'name\')') } if (!store.is.not.undefined('foo')) { return done('store.is.undefiend(\'foo\')') } return done() }) it('is empty', function (done) { let store = window.cenote() .set({ name: undefined, foo: [], test: '' }) if (!store.is.empty('test')) { return done(`!store.is.empty('test')`) } if (store.is.not.empty('foo')) { return done(!store.is.not.empty('foo')) } return done() }) it('is loading', function (done) { let store = window.cenote() .actions({ fetchData: () => new Promise(resolve => setTimeout(() => resolve(), 500)) }) if(store.is.loading('fetchData')) { return done(true) } store.fetchData() if(store.is.not.loading('fetchData')) { return done(true) } setTimeout(() => { if(store.is.loading('fetchData')) { return done(true) } return done() }, 510) }) })