Home > @loopback/testlab > TestSandbox
TestSandbox class
TestSandbox class provides a convenient way to get a reference to a sandbox folder in which you can perform operations for testing purposes.
Signature:
export declare class TestSandbox
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
|
Will create a directory if it doesn’t already exist. If it exists, you still get an instance of the TestSandbox. |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
|
|
string |
Methods
| Method | Modifiers | Description |
|---|---|---|
|
Copies a file from src to the TestSandbox. If copying a | ||
|
Deletes the TestSandbox. | ||
|
Makes a directory in the TestSandbox | ||
|
Resets the TestSandbox. (Remove all files in it). | ||
|
Creates a new file and writes the given data serialized as JSON. | ||
|
Creates a new file and writes the given data as a UTF-8-encoded text. |