Skip to content

Commit

Permalink
implement the useGlobal mock
Browse files Browse the repository at this point in the history
  • Loading branch information
christabusho committed Jul 29, 2024
1 parent 1ffc7a6 commit 0a6f725
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Empty file.
20 changes: 20 additions & 0 deletions @empirica-mocks/core/mocks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { isFunctionDeclaration } from "typescript";

export function usePlayer() {
// This is a mock function that returns a mock player object
console.log("loaded usePlayer() from react-mocks.js");
Expand Down Expand Up @@ -73,3 +75,21 @@ export function usePlayers() {

return players;
}

// Mock implementation of useGlobal
export function useGlobal() {
// This is a mock function that returns a mock global object
const global = {
isMock: true,
recruitingBatchConfig: {
cdn: 'local',
},
resourceLookup: {
cdn: 'local',
},
get: (varName) => {
return this[varName];
}
};
return global;
}

0 comments on commit 0a6f725

Please sign in to comment.