Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should error if no parameters passed', function(done) {
// arrange
var caughtErr;
// act
try {
ternaryStream();
} catch (err) {
caughtErr = err;
}
// assert
should.exist(caughtErr);
caughtErr.message.indexOf('required').should.be.above(-1);
done();
});
function(err, result) {
should.not.exist(err);
var resultVal;
if (typeof (result.outBinds.o) === 'undefined') resultVal = result.outBinds[0][0];
else resultVal = result.outBinds.o[0];
should.strictEqual(resultVal, expected);
// should.strictEqual(typeof resultVal, "string");
callback();
}
);
function(err, result) {
should.not.exist(err);
var resultVal;
if (typeof (result.outBinds.o) === 'undefined') resultVal = result.outBinds[0][0];
else resultVal = result.outBinds.o[0];
should.strictEqual(resultVal, expected);
// should.strictEqual(typeof resultVal, "string");
callback();
}
);
setTimeout(function () {
// assert
should.exist(task.err);
task.err.should.equal(expectedErr);
should.exist(task.runMethod);
task.runMethod.should.equal(expectedRunMethod);
a.should.equal(2); // task, run callback
done();
}, taskTimeout*2);
});
doneOnce.run(args, function (/*err*/) {
// assert
should.exist(task.err);
task.err.should.equal(expectedErr);
done();
});
});
it( 'creates a query folder', function( done ) {
testFolder = null;
should.exist( testProject );
should.exist( myQueries );
client.createFolder( testProject.name, 'testFolder1', myQueries.id, function( err, folder ) {
should.not.exist( err );
should.exist( folder );
// console.log(folder);
folder.should.have.property( 'id' );
folder.should.have.property( 'url' );
testFolder = folder;
done();
} );
} );
mockAsync(function() {
should.deepEqual(testid, {
s: 0,
r: {
app: "mock-MTO_XYZ",
"ver": 1
},
t: 0.001
});
}); // mock async
})
mockAsync(function() {
should.deepEqual(testid, {
s: 0,
r: {
app: "mock-MTO_FPD",
"ver": 1
},
t: 0.001
});
}); // mock async
})
n2.on("input", function(msg) {
try {
if (rval) {
msg.should.have.property("payload");
should.deepEqual(msg.payload, rval);
}
else {
msg.should.have.property("payload", val);
}
delete process.env[val];
done();
}
catch(err) { done(err); }
});
n1.emit("input", {payload:null});
it('calls back with error indicating the mistake', function () {
should.exist(error);
error.toString().should.include('post.json doesn\'t exist');
})
})