From df938d6ee833ded59f6d12528105e6165ed76a92 Mon Sep 17 00:00:00 2001 From: matt korwel Date: Mon, 16 Jun 2025 08:27:29 -0700 Subject: Preflight and integration npx (#1096) --- integration-tests/file-system.test.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 integration-tests/file-system.test.js (limited to 'integration-tests/file-system.test.js') 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')); +}); -- cgit v1.2.3