New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test object with prototype #133
Conversation
Thanks! I'll look into this asap. |
The problem is that a different test ends up failing (the one that checks that a basic function is left in tact). Hopefully there's a way to make all situations work. |
Oops, when I tested this I didn't put the call to |
test/stores/memory.unit.js
Outdated
@@ -79,6 +79,23 @@ describe("memory store", function() { | |||
}, opts, cb); | |||
} | |||
|
|||
function getCachedObjectyWithPrototype(name, cb) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: There's a stray y
after Object
in the function name.
Edit: never mind the below. Hmm.. this fails though: function getCachedNestedFunction(name, cb) {
cache.wrap(key, function(cacheCb) {
cacheCb(null, {
fizzle: function() {
return 'foo';
}
});
}, opts, cb);
}
//[...]
it("preserves nested functions", function(done) {
getCachedNestedFunction('foo', function(err, result) {
checkErr(err);
assert.equal(typeof result, 'function');
getCachedNestedFunction('foo', function(err, result) {
checkErr(err);
assert.equal(typeof result.fizzle, 'function');
done();
});
});
}); |
Thanks for the fix @ryanbecker! |
This unit test currently fails, but will pass when the cached object is either not cloned or cloned with
lodash.cloneDeep
.