test('cache key', async t => { const alfy = createAlfy(); t.deepEqual(await alfy.fetch(`${URL}/cache-key`, {query: {unicorn: 'rainbow'}, maxAge: 5000}), {unicorn: 'rainbow'}); t.truthy(alfy.cache.store['https://foo.bar/cache-key{"json":true,"query":{"unicorn":"rainbow"},"maxAge":5000}']); });
test.serial('find with option all', async t => { const stubDevice = new TuyAPI({id: '22325186db4a2217dc8e', key: '4226aa407d5c1e2b'}); const thisStub = clone(stub); thisStub.startServer(); thisStub.startUDPBroadcast({interval: 1}); const foundDevices = await stubDevice.find({all: true}); stubDevice.disconnect(); thisStub.shutdown(); await delay(100); t.truthy(foundDevices.length); });
test.serial('Main flow using service Fly', t => { const subCommand = `fly plek-test`; return promisify(exec)(`${t.context.cliPath} ${subCommand}`) .then(getStdout) .then(t.truthy); });
test('main', t => { t.true(catNames.all.length > 0); t.truthy(catNames.random()); t.not(catNames.random(), catNames.random()); t.is(catNames.all[0], 'Abby'); t.is(catNames.all[1], 'Angel'); });
test("createResource: must add the resource to the resources array", t => { const resource = t.context.context.createResource( "some", "text/html", "<div></div>" ); t.truthy( t.context.context.resources.find(aResource => aResource.id === resource.id) ); });
test("createResource: created resource must have an id", t => { const resource = t.context.context.createResource( "some", "text/html", "<div></div>" ); t.truthy(resource.id); });
test.serial('Main flow using service ZEIT Now', t => { const subCommand = `now plek-integration-test.now.sh --team devoorhoede --app plek-test -- --public`; return promisify(exec)(`${t.context.cliPath} ${subCommand}`) .then(getStdout) .then(t.truthy); });
test("createResource: created resource must have an id", t => { const resource = t.context.context.createResource( "some", "text/html", "<div></div>" ); t.truthy(resource.id); });
test("createResource: must add the resource to the resources array", t => { const resource = t.context.context.createResource( "some", "text/html", "<div></div>" ); t.truthy( t.context.context.resources.find(aResource => aResource.id === resource.id) ); });