* Creates a fake promisified readFile function from a map * @param myMap contains a filepath as the key and a ConfigFile object as the * value. * The returned function has the same interface as fs.readFile
(myMap: Map<string, ConfigFile>)
| 31 | * The returned function has the same interface as fs.readFile |
| 32 | */ |
| 33 | function createFakeReadFilep(myMap: Map<string, ConfigFile>) { |
| 34 | return (configPath: string) => { |
| 35 | const configFile = myMap.get(configPath); |
| 36 | if (configFile) { |
| 37 | return Promise.resolve(JSON.stringify(configFile)); |
| 38 | } else { |
| 39 | return Promise.reject(`${configPath} Not Found`); |
| 40 | } |
| 41 | }; |
| 42 | } |
| 43 | |
| 44 | function makeFakeFsExistsSync( |
| 45 | expected: PathLike[], |
no outgoing calls
no test coverage detected
searching dependent graphs…