diff --git a/src/common/fs/fs.injectable.ts b/src/common/fs/fs.injectable.ts index 74c3050936..05ea3b2032 100644 --- a/src/common/fs/fs.injectable.ts +++ b/src/common/fs/fs.injectable.ts @@ -29,6 +29,7 @@ const fsInjectable = getInjectable({ writeJsonSync, pathExistsSync, pathExists, + copy, } = fse; return { @@ -46,6 +47,7 @@ const fsInjectable = getInjectable({ lstat, rm, access, + copy: copy as (src: string, dest: string, options?: fse.CopyOptions) => Promise, }; }, causesSideEffects: true, diff --git a/src/test-utils/override-fs-with-fakes.ts b/src/test-utils/override-fs-with-fakes.ts index f259d0ac92..a144e99d97 100644 --- a/src/test-utils/override-fs-with-fakes.ts +++ b/src/test-utils/override-fs-with-fakes.ts @@ -5,7 +5,10 @@ import type { DiContainer } from "@ogre-tools/injectable"; import fsInjectable from "../common/fs/fs.injectable"; import { createFsFromVolume, Volume } from "memfs"; -import type { readJsonSync as readJsonSyncImpl, writeJsonSync as writeJsonSyncImpl } from "fs-extra"; +import type { + readJsonSync as readJsonSyncImpl, + writeJsonSync as writeJsonSyncImpl, +} from "fs-extra"; export const getOverrideFsWithFakes = () => { const root = createFsFromVolume(Volume.fromJSON({})); @@ -46,6 +49,7 @@ export const getOverrideFsWithFakes = () => { lstat: root.promises.lstat as any, rm: root.promises.rm, access: root.promises.access, + copy: async (src, dest) => { throw new Error(`Tried to copy '${src}' to '${dest}'. Copying is not yet supported`); }, })); }; };