Skip to content

Commit cba536d

Browse files
committed
fix(endpoint-cache): do not use defaults for Address or CachePeriodInMinutes
1 parent 0bb72ef commit cba536d

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

packages/endpoint-cache/src/EndpointCache.spec.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,20 +144,6 @@ describe(EndpointCache.name, () => {
144144
}))
145145
);
146146
});
147-
148-
it("sets Address to empty string if not passed", () => {
149-
const mockEnpointsNoAddr = [{ CachePeriodInMinutes: 1 }];
150-
endpointCache.set(key, mockEnpointsNoAddr);
151-
expect(set).toHaveBeenCalledTimes(1);
152-
expect(set).toHaveBeenCalledWith(key, [{ Address: "", Expires: now + 60 * 1000 }]);
153-
});
154-
155-
it("sets Expires in one minute if CachePeriodInMinutes is not passed", () => {
156-
const mockEnpointsNoAddr = [{ Address: "address" }];
157-
endpointCache.set(key, mockEnpointsNoAddr);
158-
expect(set).toHaveBeenCalledTimes(1);
159-
expect(set).toHaveBeenCalledWith(key, [{ Address: "address", Expires: now + 60 * 1000 }]);
160-
});
161147
});
162148

163149
it("delete", () => {

packages/endpoint-cache/src/EndpointCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class EndpointCache {
6868
const now = Date.now();
6969
this.cache.set(
7070
key,
71-
endpoints.map(({ Address = "", CachePeriodInMinutes = 1 }) => ({
71+
endpoints.map(({ Address, CachePeriodInMinutes }) => ({
7272
Address,
7373
Expires: now + CachePeriodInMinutes * 60 * 1000,
7474
}))

0 commit comments

Comments
 (0)