Defined in: packages/fs-testkit/src/sandbox.js:37
new Sandbox(options?): Sandbox;
Defined in: packages/fs-testkit/src/sandbox.js:93
| Parameter | Type | Description |
|---|---|---|
options? | Partial<InputSandboxOptions> | - |
Sandbox
get options(): SettledSandboxOptions;
Defined in: packages/fs-testkit/src/sandbox.js:237
Read-only options used by the Sandbox instance. Can only be checked after setup has been called and all options have settled
get root(): Dir;
Defined in: packages/fs-testkit/src/sandbox.js:229
The Dir representing the root directory of the sandbox
get rootPath(): string;
Defined in: packages/fs-testkit/src/sandbox.js:220
The path to the root directory of the sandbox
string
get snapshot(): Snapshot;
Defined in: packages/fs-testkit/src/sandbox.js:85
at(path, type?): File | Dir;
Defined in: packages/fs-testkit/src/sandbox.js:289
Create a Dir or File at a given path relative to sandbox root.
The returned instance is inferred based on whether the relative path has an extension,
this can be forced by specifying the type argument.
| Parameter | Type | Description |
|---|---|---|
path | string | - |
type? | "Dir" | "File" | - |
copyFromExternal(srcAbsolutePath, options): Promise<(File | Dir)[]>;
Defined in: packages/fs-testkit/src/sandbox.js:310
| Parameter | Type | Description |
|---|---|---|
srcAbsolutePath | string | - |
options | | { as?: string; contentsOnly?: boolean; overwrite?: boolean; recursive?: boolean; } | undefined | - |
destroy(): Promise<void>;
Defined in: packages/fs-testkit/src/sandbox.js:318
Delete the sandbox root and its contents
Promise<void>
dir(name): Dir;
Defined in: packages/fs-testkit/src/sandbox.js:265
Create a Dir instance with the sandbox root as the parent
| Parameter | Type | Description |
|---|---|---|
name | string | - |
file(name): File;
Defined in: packages/fs-testkit/src/sandbox.js:256
Create a File instance with the sandbox root as the parent
| Parameter | Type | Description |
|---|---|---|
name | string | - |
scaffold<T, Opts>(scaffoldDir, options?): Promise<ScaffoldResult<T, Opts>>;
Defined in: packages/fs-testkit/src/sandbox.js:301
Scaffold nested files and directories on the file system, from the sandbox root
| Type Parameter | Default type | Description |
|---|---|---|
T extends ScaffoldDir<ScaffoldFile> | - | |
Opts extends ScaffoldOptions | object |
| Parameter | Type | Description |
|---|---|---|
scaffoldDir | T | - |
options? | Opts | - |
Promise<ScaffoldResult<T, Opts>>
setup(): Promise<void>;
Defined in: packages/fs-testkit/src/sandbox.js:134
It is generally preferred to use createSandbox which will create an instance and handle async setup.
Only call this function if creating an instance manually using the Sandbox constructor
Promise<void>