it( 'should return true when post.status is pending', function() { assert( postUtils.isPending( { status: 'pending' } ) ); } );
client.on("error", function(e){ assert(e.message === "cannot send frame on closed stream"); done(); });
.on('data', function(data) { assert(data instanceof AudioBuffer); done(); });
var fail = function(){assert(false);};
client.on("finish", function(){ finished = true; assert(!ended); });
setupTransaction(function(transaction){ assert(transaction.id === 1); done(); });
setupTransaction(function(transaction){ var frame = transaction.send({destination:"/abc"}); assert(frame.command === "SEND"); assert(frame.headers["transaction"] === 1 || frame.headers["transaction"] === "1"); frame.end(); });
bot.dig(bot.blockAt(bot.entity.position.plus(new Vec3(1, 0, 0))), function(err) { assert(!err); cb(); });
var checkerr = function(err) { assert(!err, err); };
it( 'should return true when status === future and date is in the past', function() { const tenMinutes = 1000 * 60; const postDate = Date.now() - tenMinutes; assert( postUtils.isBackDatedPublished( { status: 'future', date: postDate } ) ); } );
waitsForPromise(async () => { invariant(typeRegistry); // {kind: 'bork'; n: number } const o1: ObjectType = { location: builtinLocation, kind: 'object', fields: [ { location: builtinLocation, type: a1, name: 'kind', optional: false, }, { location: builtinLocation, type: numberType, name: 'n', optional: false, }, ], }; // {kind: 'bork!'; s: string } const o2: ObjectType = { location: builtinLocation, kind: 'object', fields: [ { location: builtinLocation, type: a2, name: 'kind', optional: false, }, { location: builtinLocation, type: stringType, name: 's', optional: false, }, ], }; // {kind: 42; b: boolean } const o3: ObjectType = { location: builtinLocation, kind: 'object', fields: [ { location: builtinLocation, type: a3, name: 'kind', optional: false, }, { location: builtinLocation, type: booleanType, name: 'b', optional: false, }, ], }; const type = { location: builtinLocation, kind: 'union', types: [o1, o2, o3], discriminantField: 'kind', }; const data1 = {kind: 'bork', n: 42}; const result1 = await typeRegistry.unmarshal(await typeRegistry.marshal(data1, type), type); expect(result1).toEqual(data1); const data2 = {kind: 'bork!', s: 'hello'}; const result2 = await typeRegistry.unmarshal(await typeRegistry.marshal(data2, type), type); expect(result2).toEqual(data2); const data3 = {kind: 42, b: true}; const result3 = await typeRegistry.unmarshal(await typeRegistry.marshal(data3, type), type); expect(result3).toEqual(data3); // Ensure no extra fields are accidentally marshalled. const data4 = {kind: 'bork', n: 42, s: 'hello', b: true}; const result4 = await typeRegistry.unmarshal(await typeRegistry.marshal(data4, type), type); expect(result4).toEqual(data1); const data5 = {kind: 'not bork!'}; let thrown = false; try { await typeRegistry.marshal(data5, type); } catch (e) { thrown = true; } expect(thrown).toBe(true); });
it( 'should return false when status !== future', function() { assert( ! postUtils.isBackDatedPublished( { status: 'draft' } ) ); } );
it( 'should return false when no post is supplied', function() { assert( ! postUtils.isBackDatedPublished() ); } );
it( 'should return false when post.status is not pending', function() { assert( ! postUtils.isPending( { status: 'draft' } ) ); } );
server._unsubscribe = function(){assert(false);};
q2.on('complete', function() { assert(!calledq2); calledq2 = true; setTimeout(checkdone, 10); });
client.connect("localhost", function(){ assert(serverConnected); assert(clientConnected); done(); });
harness.getClient().flushall(function(err) { assert(!err); done(); });
server._send = function(frame){ assert(frame.headers["transaction"] === 1 || frame.headers["transaction"] === "1"); done(); };
stream.on('end', () => { assert(data_count > 0, 'emitted \'data\'') assert(hit_count === 1, 'emitted EXAMPLE_FEED_1') t.end() })
server._commit = function(frame){ assert(frame.headers["transaction"] === "1"); done(); };
frame.on("end", function(){ beforeSendResponse(); assert(writable.getWrittenSlice().toString() === "abcdefgh"); done(); });
server._disconnect = function(frame, beforeSendResponse){ beforeSendResponse(); assert(frame.headers.hasOwnProperty("receipt")); done(); };
client.once("error", function(exception){ assert(exception instanceof Error); assert(exception.message === "test message"); done(); });
client.on("end", function(){ ended = true; assert(finished); done(); });
client.on("error", function(){assert(false);});
.on('data', function(chunk) { assert(chunk instanceof Buffer); done(); });
client.once("error", function(exception){ assert(exception.message === "Protocol error: unknown command 'FOIDSUF'"); done(); });
pub.close(function(){ assert(n === 3); done(); });
it( 'should return undefined when no post is supplied', function() { assert( postUtils.isPending() === undefined ); } );