From 41833a7ced32dec19ad6af30bc2bc886c91a68aa Mon Sep 17 00:00:00 2001 From: Ferran Llop Date: Thu, 2 Jun 2022 10:50:33 +0200 Subject: [PATCH] docs: Update file commands examples to show its use with the payload object argument --- docs/docs/test-runner/commands.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/docs/test-runner/commands.md b/docs/docs/test-runner/commands.md index 0c1e0ae89..cfabe435b 100644 --- a/docs/docs/test-runner/commands.md +++ b/docs/docs/test-runner/commands.md @@ -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' }); }); ```