UNPKG

1.95 kBTypeScriptView Raw
1import type { execaCommand } from 'execa';
2import { StrykerOptions } from '@stryker-mutator/api/core';
3import { I } from '@stryker-mutator/util';
4import { Logger } from '@stryker-mutator/api/logging';
5import { Disposable } from '@stryker-mutator/api/plugin';
6import { TemporaryDirectory } from '../utils/temporary-directory.js';
7import { UnexpectedExitHandler } from '../unexpected-exit-handler.js';
8import { Project } from '../fs/project.js';
9export declare class Sandbox implements Disposable {
10 private readonly options;
11 private readonly log;
12 private readonly temporaryDirectory;
13 private readonly project;
14 private readonly execCommand;
15 private readonly fileMap;
16 /**
17 * The working directory for this sandbox
18 * Either an actual sandbox directory, or the cwd when running in --inPlace mode
19 */
20 readonly workingDirectory: string;
21 /**
22 * The backup directory when running in --inPlace mode
23 */
24 private readonly backupDirectory;
25 /**
26 * The sandbox dir or the backup dir when running in `--inPlace` mode
27 */
28 private readonly tempDirectory;
29 static readonly inject: ["options", "logger", "temporaryDirectory", "project", "execa", "unexpectedExitRegistry"];
30 constructor(options: StrykerOptions, log: Logger, temporaryDirectory: I<TemporaryDirectory>, project: Project, execCommand: typeof execaCommand, unexpectedExitHandler: I<UnexpectedExitHandler>);
31 init(): Promise<void>;
32 sandboxFileFor(fileName: string): string;
33 originalFileFor(sandboxFileName: string): string;
34 private fillSandbox;
35 private runBuildCommand;
36 private symlinkNodeModulesIfNeeded;
37 /**
38 * Sandboxes a file (writes it to the sandbox). Either in-place, or an actual sandbox directory.
39 * @param name The name of the file
40 * @param file The file reference
41 */
42 private sandboxFile;
43 dispose(unexpected?: boolean): void;
44}
45//# sourceMappingURL=sandbox.d.ts.map
\No newline at end of file