Skip to content

Commit

Permalink
Merge pull request #146 from Myongji-Graduate/fix/storybook-error
Browse files Browse the repository at this point in the history
fix: next cookies mocking
  • Loading branch information
gahyuun authored Sep 11, 2024
2 parents fc4b6d6 + 24a9839 commit 3a74266
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 3a74266

Please sign in to comment.