(global: string, target: string | Error)
| 7 | import { tmpdir } from "../fixture/fixture" |
| 8 | |
| 9 | function deps(global: string, target: string | Error): PlugDeps { |
| 10 | return { |
| 11 | spinner: () => ({ |
| 12 | start() {}, |
| 13 | stop() {}, |
| 14 | }), |
| 15 | log: { |
| 16 | error() {}, |
| 17 | info() {}, |
| 18 | success() {}, |
| 19 | }, |
| 20 | resolve: async () => { |
| 21 | if (target instanceof Error) throw target |
| 22 | return target |
| 23 | }, |
| 24 | readText: (file) => Filesystem.readText(file), |
| 25 | write: async (file, text) => { |
| 26 | await Filesystem.write(file, text) |
| 27 | }, |
| 28 | exists: (file) => Filesystem.exists(file), |
| 29 | files: (dir, name) => [path.join(dir, `${name}.jsonc`), path.join(dir, `${name}.json`)], |
| 30 | global, |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | function ctx(dir: string): PlugCtx { |
| 35 | return { |
no test coverage detected