Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions docs/docs/test-runner/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,15 @@ The file commands allow writing, reading and removing files. The specified path
import { writeFile, readFile, removeFile } from '@web/test-runner-commands';

it('can use file commands', async () => {
await writeFile('test-data/hello-world.txt', 'Hello world!');
await writeFile({
path: 'test-data/hello-world.txt',
content: 'Hello world!',
});

const content = await readFile('test-data/hello-world.txt');
const content = await readFile({ path: 'test-data/hello-world.txt' });
console.log(content); // 'Hello world!'

await removeFile('test-data/hello-world.txt');
await removeFile({ path: 'test-data/hello-world.txt' });
});
```

Expand Down