UNPKG

@loopback/docs

Version:
46 lines (31 loc) 1.86 kB
--- lang: en title: 'API docs: testlab.testsandbox' keywords: LoopBack 4.0, LoopBack 4 sidebar: lb4_sidebar permalink: /doc/en/lb4/apidocs.testlab.testsandbox.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/testlab](./testlab.md) &gt; [TestSandbox](./testlab.testsandbox.md) ## 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. <b>Signature:</b> ```typescript export declare class TestSandbox ``` ## Constructors | Constructor | Modifiers | Description | | --- | --- | --- | | [(constructor)(path)](./testlab.testsandbox._constructor_.md) | | 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 | | --- | --- | --- | --- | | [path](./testlab.testsandbox.path.md) | | <code>string</code> | | ## Methods | Method | Modifiers | Description | | --- | --- | --- | | [copyFile(src, dest)](./testlab.testsandbox.copyfile.md) | | Copies a file from src to the TestSandbox. If copying a <code>.js</code> file which has an accompanying <code>.js.map</code> file in the src file location, the dest file will have its sourceMappingURL updated to point to the original file as an absolute path so you don't need to copy the map file. | | [delete()](./testlab.testsandbox.delete.md) | | Deletes the TestSandbox. | | [getPath()](./testlab.testsandbox.getpath.md) | | Returns the path of the TestSandbox | | [mkdir(dir)](./testlab.testsandbox.mkdir.md) | | Makes a directory in the TestSandbox | | [reset()](./testlab.testsandbox.reset.md) | | Resets the TestSandbox. (Remove all files in it). |