Skip to content

Commit

Permalink
fix: next cookies mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
gahyuun committed Sep 11, 2024
1 parent fc4b6d6 commit 24a9839
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/utils/test/__mock__/next/headers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
const store: { [key: string]: { value: unknown } } = {};
export function cookies() {
return {
set: () => {},
get: () => {},
set: (key: string, value: unknown) => {
store[key] = {
value,
};
console.log(store[key]);
},
get: (key: string) => {
return store[key];
},
};
}

0 comments on commit 24a9839

Please sign in to comment.