MCPcopy Create free account
hub / github.com/api3dao/airnode / mockReadFileSync

Function mockReadFileSync

packages/airnode-deployer/test/mock-utils.ts:12–20  ·  view source on GitHub ↗
(filePathSubstr: string, mockValue: string)

Source from the content-addressed store, hash-verified

10 * and otherwise returns the original content.
11 */
12export const mockReadFileSync = (filePathSubstr: string, mockValue: string) => {
13 return jest.spyOn(fs, 'readFileSync').mockImplementation((...args) => {
14 const path = args[0].toString();
15 if (path.includes(filePathSubstr)) {
16 return mockValue;
17 }
18 return originalFs(...args);
19 });
20};

Callers 2

validation.test.tsFile · 0.90
commands.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected