diff options
| author | matt korwel <[email protected]> | 2025-06-16 08:27:29 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-16 15:27:29 +0000 |
| commit | df938d6ee833ded59f6d12528105e6165ed76a92 (patch) | |
| tree | 712b82037a378b74f5fd68ed5b06f1aae56a88c9 /integration-tests/file-system.test.js | |
| parent | a600588c200f85e9f3bfe46ef7f836387e7349e5 (diff) | |
Preflight and integration npx (#1096)
Diffstat (limited to 'integration-tests/file-system.test.js')
| -rw-r--r-- | integration-tests/file-system.test.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/integration-tests/file-system.test.js b/integration-tests/file-system.test.js new file mode 100644 index 00000000..87e9efe2 --- /dev/null +++ b/integration-tests/file-system.test.js @@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2025 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ + +import { strict as assert } from 'assert'; +import { test } from 'node:test'; +import { TestRig } from './test-helper.js'; + +test('reads a file', (t) => { + const rig = new TestRig(); + rig.setup(t.name); + rig.createFile('test.txt', 'hello world'); + + const output = rig.run(`read the file name test.txt`); + + assert.ok(output.toLowerCase().includes('hello')); +}); + +test('writes a file', (t) => { + const rig = new TestRig(); + rig.setup(t.name); + rig.createFile('test.txt', ''); + + rig.run(`edit test.txt to have a hello world message`); + + const fileContent = rig.readFile('test.txt'); + assert.ok(fileContent.toLowerCase().includes('hello')); +}); |
