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 require a file extension', function () {
var error;
try {
res = resolver.create({ root: '' });
} catch (err) {
error = err;
} finally {
assert.isObject(error);
}
});
it('should add a recipe', () => {
let recipe = getHydrator().addRecipe(null, 'foo', getManager().getMapping(User), 'single');
assert.deepEqual(recipe.primaryKey, { alias: 'foo.id', property: 'id' });
assert.isNull(recipe.parent);
assert.isFalse(recipe.hydrate);
assert.equal(recipe.type, 'single');
assert.isObject(recipe.columns);
assert.isUndefined(recipe.property);
assert.equal(recipe.alias, 'foo');
});
});
it('should be an object', () => {
assert.isObject(item);
});
request({ method: "get", path: "/login" }, null, function(error, resp){
assert.notOk(error, "Token creation did not return an error");
assert.isObject(resp, "Response is an object");
assert.property(resp, "token", "Response contains a token property");
assert.isString(resp.token, "Token is a string");
token = resp.token;
server.removeRoute("/login", "get");
done();
});
bundle.load(function (err, bundle) {
assert.isObject(err);
assert.equal(err.message, 'Content bundle not found: unknown');
assert.isNotObject(bundle);
next();
});
});
const assertReceipt = (receipt) => {
assert.isNotNull(receipt, 'Transaction Receipt is null');
assert.isObject(receipt, 'Transaction Receipt is not an object');
assert.isTrue(receipt.status, 'Transaction failed.');
return receipt;
};
'getting state'() {
assert.isObject(myStore.getState()._dispatcher, 'the dispatcher is exposed internally')
assert(lifecycleStore.getState().bootstrapped === false, 'bootstrap has not been called yet')
assert(lifecycleStore.getState().snapshotted === false, 'takeSnapshot has not been called yet')
assert(lifecycleStore.getState().serialized === false, 'takeSnapshot has not been called yet')
assert(lifecycleStore.getState().rollback === false, 'rollback has not been called')
assert(lifecycleStore.getState().init === true, 'init gets called when store initializes')
assert(lifecycleStore.getState().deserialized === true, 'deserialize has not been called yet')
},
const assertReceipt = (receipt) => {
assert.isNotNull(receipt, 'Transaction Receipt is null');
assert.isObject(receipt, 'Transaction Receipt is not an object');
assert.isTrue(receipt.status, 'Transaction failed.');
return receipt;
};
resolver.resolveFile(path.join(process.cwd(), 'fixtures', 'data.txt'), function (err, data) {
assert.isObject(data);
assert.strictEqual(data.foo, 'bar');
assert.strictEqual(data.foobar, 'foo bar');
assert.isString(data.file);
assert.isFunction(data.method);
assert(Buffer.isBuffer(data.buffer));
assert.strictEqual(data.buffer.toString(), 'Hello, world!');
next();
});
});