(filePathSubstr: string, mockValue: string)
| 120 | * and otherwise returns the original content. |
| 121 | */ |
| 122 | export const mockReadFileSync = (filePathSubstr: string, mockValue: string) => { |
| 123 | return jest.spyOn(fs, 'readFileSync').mockImplementation((...args) => { |
| 124 | const path = args[0].toString(); |
| 125 | if (path.includes(filePathSubstr)) { |
| 126 | return mockValue; |
| 127 | } |
| 128 | return originalFs(...args); |
| 129 | }); |
| 130 | }; |
no outgoing calls
no test coverage detected