Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"Converting a valid KeyboardEvent object that would result in an invalid Combo returns null": function() {
// Simulated KeyboardEvent
var ev = {
which: null,
shiftKey: false,
altKey: false,
metaKey: false,
ctrlKey: false
};
var combo = Combo.fromEvent(ev);
assert.isNull(combo);
},
"Converting a null or invalid KeyboardEvent object returns null": function() {
return function testIO(err, output) {
assert.isNull(err); // no errors
assert.strictEqual(output, expected); // last actual ouput equals expected
};
}
function assertCorrectResponse(err,data){
assert.isNull(err);
assert.isObject(data);
assert.equal(data.responseHeader.status,0);
assert.isObject(data.moreLikeThis);
assert.equal(data.responseHeader.params['mlt.fl'],'title_t,description_t');
assert.equal(data.responseHeader.params['mlt.mintf'],'1');
assert.equal(data.responseHeader.params['mlt.mindf'],'1');
assert.equal(data.responseHeader.params['mlt.minwl'],'3');
assert.equal(data.responseHeader.params['mlt.maxwl'],'5');
assert.equal(data.responseHeader.params['mlt.maxqt'],'8');
assert.equal(data.responseHeader.params['mlt.maxntp'],'9');
assert.equal(data.responseHeader.params['mlt.boost'],'true');
assert.equal(data.responseHeader.params['mlt.qf'],'title_t^2 description_t^3');
assert.equal(data.responseHeader.params['mlt'],'true');
assert.equal(data.responseHeader.params['mlt.count'],'10');
}
'null': function (topic) {
var null_value = topic.get_icon();
assert.isNull(null_value);
}
},
'the process pid should be null': function (error, monitor) {
assert.ifError(error);
assert.isNull(monitor.pid.process);
}
},
'should return null after the timeout': function (err, nil) {
assert.isNull(nil);
},
'success' : function( err, message ){
assert.isNull( err );
assert.deepEqual( message, params );
},
'close connection' : {
"deserializing an empty JSON string returns null": function() {
var result = Combo.deserialize('');
assert.isNull(result);
},
"deserializing a non-Combo object using Combo.deserialize throws an Error": function() {
"outer": function(tbl) {
var report = {};
var song = tbl.one(
{ title: {like$: "アルメ"}
},
{ explain: report,
join: { tag : { via : "song_tag", as : "tags", outer: true, word: {like$: "cccc"} } }
}
);
assert.isNull(song.tags);
},
},
"a dir with a reduced number of files": function (error,files) {
assert.isNull(error);
assert.equal(files.length,0);
}
}