Skip to content

Commit

Permalink
Adding CacheKeys for Cache in Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bcameron1231 committed Nov 28, 2023
1 parent d96c7be commit f8c5251
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions test/queryable/behaviors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Timeout,
RejectOnError,
ResolveOnData,
CacheKey,
} from "@pnp/queryable";
import { default as nodeFetch } from "node-fetch";
import "@pnp/sp/webs";
Expand All @@ -24,9 +25,7 @@ describe("Behaviors", function () {
}

// Testing a behavior, creating new instance of sp
const spInstance = spfi(this.pnp._sp).using(CachingPessimisticRefresh({
store: "session",
}));
const spInstance = spfi(this.pnp._sp).using(CachingPessimisticRefresh({store: "session"}),CacheKey("CachingPessimistic"));

// Test caching behavior
const startCheckpoint = new Date();
Expand All @@ -53,9 +52,7 @@ describe("Behaviors", function () {
}

// Testing a behavior, creating new instance of sp
const spInstance = spfi(this.pnp._sp).using(CachingPessimisticRefresh({
store: "session",
}));
const spInstance = spfi(this.pnp._sp).using(CachingPessimisticRefresh({store: "session"}),CacheKey("CachingPessimisticHeaders"));

// Add a text field, which augments header, to validate that CachingPessimisticRefresh execute function honors header
const testFieldNameRand = `CachingPessimisticRefreshField_${getRandomString(10)}`;
Expand Down Expand Up @@ -87,7 +84,7 @@ describe("Behaviors", function () {
}

// Testing a behavior, creating new instance of sp
const spInstance = spfi(this.pnp._sp).using(Caching({ store: "session" }));
const spInstance = spfi(this.pnp._sp).using(Caching({ store: "session"}),CacheKey("Caching"));

// Test caching behavior
const startCheckpoint = new Date();
Expand Down

0 comments on commit f8c5251

Please sign in to comment.