[Persistence] Add test case
Add test case for cache to ensure the same object instance is given for multiple read calls, as this addresses WTD-791.
This commit is contained in:
@@ -77,6 +77,17 @@ define(
|
||||
|
||||
});
|
||||
|
||||
it("gives a single instance of cached objects", function () {
|
||||
// Perform two reads
|
||||
decorator.readObject(testSpace, "someKey", "someValue")
|
||||
.then(mockCallback);
|
||||
decorator.readObject(testSpace, "someKey", "someValue")
|
||||
.then(mockCallback);
|
||||
|
||||
// Results should have been pointer-identical
|
||||
expect(mockCallback.calls[0].args[0])
|
||||
.toBe(mockCallback.calls[1].args[0]);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user