-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5469 from flexion/devex-custom-case-no-appcontext
No App Context Experiment
- Loading branch information
Showing
30 changed files
with
362 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
shared/src/proxies/customCaseReport/createCsvCustomCaseReportFileProxy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
export const mockFactory = method => { | ||
export const mockFactory = (method: string) => { | ||
return { | ||
[method]: jest.fn(() => | ||
console.debug(`${method} was not implemented, using default mock`), | ||
), | ||
}; | ||
}; | ||
|
||
export const mockEntireFile = ({ | ||
keepImplementation = false, | ||
module, | ||
}: { | ||
module: string; | ||
keepImplementation?: boolean; | ||
}) => { | ||
const originalModule = jest.requireActual(module); | ||
|
||
Object.keys(originalModule).forEach(method => { | ||
if (typeof originalModule[method] === 'function') { | ||
const dummyImplementation = () => | ||
console.debug(`${method} was not implemented, using default mock`); | ||
|
||
originalModule[method] = keepImplementation | ||
? jest.fn(originalModule[method]) | ||
: jest.fn(dummyImplementation); | ||
} | ||
}); | ||
|
||
return originalModule; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.