@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
37 lines (24 loc) • 1.44 kB
Markdown
lang: en
title: 'API docs: testlab.testsandbox.copyfile'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/testlab
permalink: /doc/en/lb4/apidocs.testlab.testsandbox.copyfile.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/testlab](./testlab.md) > [TestSandbox](./testlab.testsandbox.md) > [copyFile](./testlab.testsandbox.copyfile.md)
## TestSandbox.copyFile() method
Copies a file from src to the TestSandbox. If copying a `.js` file which has an accompanying `.js.map` 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.
<b>Signature:</b>
```typescript
copyFile(src: string, dest?: string, transform?: (content: string) => string): Promise<void>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| src | string | Absolute path of file to be copied to the TestSandbox |
| dest | string | Optional. Destination filename of the copy operation (relative to TestSandbox). Original filename used if not specified. |
| transform | (content: string) => string | Optional. A function to transform the file content. |
<b>Returns:</b>
Promise<void>