['1', '2', '3', '4', '5'].map((v) => assert.property(app.histogram, v)); app.screenshots.map(assertValidUrl); app.comments.map(assert.isString);
['1', '2', '3', '4', '5'].map((v) => assert.property(app.histogram, v));
['1', '2', '3', '4', '5'].map((v) => assert.property(app.histogram, v)); app.screenshots.map(assertValidUrl); app.comments.map(assert.isString);
describe( 'resolve', function() { describe( 'props', function ( ) { it( 'should define a resolve property', function () { assert.property( webpack.config, 'resolve' ); } ); it( 'should be of type object', function () { assert.isObject( webpack.config.resolve ); } ); it( 'should contain a extensions array', function () { assert.isArray( webpack.config.resolve.extensions ); } ); } ); } );
it('INSERT: should insert new item with new field by transform function', async () => { await pushStream({ event: insertEvent, index: INDEX, type: TYPE, endpoint: ES_ENDPOINT, testMode: true, transformFunction: insertFullAddress }) const keys = converter(insertEvent.Records[0].dynamodb.Keys) const result = await fetch(`${ES_ENDPOINT}/${INDEX}/${TYPE}/${keys.url}`) const body = await result.json() assert.isTrue(body.found) assert.property(body._source, 'full_address') })
it('INSERT: should insert new item with new field from transform promise func', async () => { await pushStream({ event: insertEvent, index: INDEX, type: TYPE, endpoint: ES_ENDPOINT, testMode: true, transformFunction: transformPromise(true) }) const keys = converter(insertEvent.Records[0].dynamodb.Keys) const result = await fetch(`${ES_ENDPOINT}/${INDEX}/${TYPE}/${keys.url}`) const body = await result.json() assert.isTrue(body.found) assert.property(body._source, 'foo') assert.equal(body._source.foo, 'bar') })
describe('`getSupportedElementTypeRuleSets()`', function() { it('returns all the supported rule sets', function() { const ruleSets = formComponent.getSupportedElementTypeRuleSets(); assert.property(ruleSets, 'text'); assert.isTrue(ruleSets.text.isFormationRuleSet()); assert.property(ruleSets, 'checkbox'); assert.isTrue(ruleSets.checkbox.isFormationRuleSet()); assert.property(ruleSets, 'radio'); assert.isTrue(ruleSets.radio.isFormationRuleSet()); assert.property(ruleSets, 'select'); assert.isTrue(ruleSets.select.isFormationRuleSet()); }); });
test('adding packages to the sending queue', (done) => { client.init({ startDiscovery: false }, () => { assert.equal(client.sequenceNumber, 0, 'starts sequence with 0'); assert.lengthOf(client.messagesQueue, 0, 'is empty'); client.send(packet.create('getService', {}, '12345678')); assert.equal(client.sequenceNumber, 0, 'sequence is the same after broadcast'); assert.lengthOf(client.messagesQueue, 1, 'added to message queue'); assert.property(client.messagesQueue[0], 'data', 'has data'); assert.notProperty(client.messagesQueue[0], 'address', 'broadcast has no target address'); client.send(packet.create('setPower', {level: 65535, duration: 0, target: 'f37a4311b857'}, '12345678')); assert.equal(client.sequenceNumber, 1, 'sequence increased after specific targeting'); client.sequenceNumber = constants.PACKET_HEADER_SEQUENCE_MAX; client.send(packet.create('setPower', {level: 65535, duration: 0, target: 'f37a4311b857'}, '12345678')); assert.equal(client.sequenceNumber, 0, 'sequence starts over after maximum'); done(); }); });
/** * Loops through feeds and tests each property * @param {array} feeds Networks to tests * @param {object} res Data returned from method */ function socialMediaParser(feeds, res) { for (let i = 0; i < feeds.length; i++) { assert.property(res, feeds[i], `${feeds[i]} property exists`); assert.property(res[feeds[i]], 'account', `${feeds[i]} account property exists`); assert.property(res[feeds[i]].account, 'name', `${feeds[i]} name property exists`); assert.property(res[feeds[i]].account, 'profileImage', `${feeds[i]} profileImage property exists`); assert.property(res[feeds[i]], 'items', `${feeds[i]} items property exists`); assert.property(res[feeds[i]], '_meta', `${feeds[i]} _meta property exists`); assert.isAbove(res[feeds[i]].items.length, 0, `Items returned from ${feeds[i]}`); if (feeds.indexOf('facebook') === -1) assert.notDeepProperty(res, 'facebook.items', 'facebook property should not exist'); if (feeds.indexOf('twitter') === -1) assert.notDeepProperty(res, 'twitter.items', 'twitter property should not exist'); if (feeds.indexOf('google') === -1) assert.notDeepProperty(res, 'google.items', 'google property should not exist'); if (feeds.indexOf('instagram') === -1) assert.notDeepProperty(res, 'instagram.items', 'instagram property should not exist'); } }
describe('@slack/events-api', function () { it('should export "verifyRequestSignature"', function () { assert.property(library, 'verifyRequestSignature'); }); it('should export "createEventAdapter"', function () { assert.property(library, 'createEventAdapter'); }); it('should export "errorCodes"', function () { assert.property(library, 'errorCodes'); }); });
Table.query('name', '=', 'query-a') .then((result) => { assert.property(result, 'Items'); assert.deepEqual(result.Items, [item]); }) .query('name', '=', 'query') .then((result) => { assert.property(result, 'Items'); assert.deepEqual(result.Items, [{ status: 3 }]); }); .query('name', '=', 'query') .then((result) => { assert.property(result, 'Items'); assert.deepEqual(result.Items, [{ status: 3, name: 'query' }]); });
it('INSERT: should insert new item with new field from transform promise func', async () => { await pushStream({ event: insertEvent, index: INDEX, type: TYPE, endpoint: ES_ENDPOINT, testMode: true, transformFunction: transformPromiseTimeout(true) }) const keys = converter(insertEvent.Records[0].dynamodb.Keys) const result = await fetch(`${ES_ENDPOINT}/${INDEX}/${TYPE}/${keys.url}`) const body = await result.json() assert.isTrue(body.found) assert.property(body._source, 'foo') assert.equal(body._source.foo, 'bar') })