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 return default values when graphs cannot be found and default values are provided', function (done) {
var mock = mockObject();
var leetMock = leet(mock);
var args = {
'firstName': 'Steve',
'address.county': 'North County',
'phoneNumber.1.areaCode': '555'
};
var actual = leetMock.collect(args);
assert.lengthOf(actual, 3);
assert.equal(actual[0], 'John');
assert.equal(actual[1], args['address.county']);
assert.equal(actual[2], args['phoneNumber.1.areaCode']);
done();
});
});
var mock = mockObject();
var leetMock = leet(mock);
var args = {
'firstName': 'Steve',
'address.county': 'North County',
'phoneNumber.1.areaCode': '555'
};
var actual = leetMock.extract(args);
assert.equal(Object.keys(actual).length, 3);
assert.property(actual, 'firstName');
assert.isTrue(actual.hasOwnProperty('address.county'));
assert.isTrue(actual.hasOwnProperty('phoneNumber.1.areaCode'));
assert.equal(actual['firstName'], 'John');
assert.equal(actual['address.county'], args['address.county']);
assert.equal(actual['phoneNumber.1.areaCode'], args['phoneNumber.1.areaCode']);
done();
});
});