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

Function mockReadFileSync

packages/airnode-node/test/mock-utils.ts:122–130  ·  view source on GitHub ↗
(filePathSubstr: string, mockValue: string)

Source from the content-addressed store, hash-verified

120 * and otherwise returns the original content.
121 */
122export 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};

Calls

no outgoing calls

Tested by

no test coverage detected