about summary refs log tree commit diff stats
path: root/js/scripting-lang/scripting-harness/examples/simple-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/scripting-harness/examples/simple-test.js')
-rw-r--r--js/scripting-lang/scripting-harness/examples/simple-test.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/js/scripting-lang/scripting-harness/examples/simple-test.js b/js/scripting-lang/scripting-harness/examples/simple-test.js
new file mode 100644
index 0000000..7898e80
--- /dev/null
+++ b/js/scripting-lang/scripting-harness/examples/simple-test.js
@@ -0,0 +1,39 @@
+/**
+ * Simple Test - Debug harness integration
+ */
+
+import { FunctionalHarness } from '../core/harness.js';
+
+// Very simple script
+const simpleScript = `
+/* Simple test script */
+
+/* Get current state */
+state : ..listen;
+
+/* Emit the state */
+..emit state;
+`;
+
+async function runSimpleTest() {
+    console.log('=== Simple Harness Test ===\n');
+
+    // Create harness with script content
+    const harness = new FunctionalHarness(simpleScript, {
+        logStateChanges: true,
+        logCommands: true
+    });
+
+    // Simple initial state
+    const initialState = {
+        message: "Hello World",
+        value: 42
+    };
+
+    console.log('Processing state...');
+    const result = await harness.processState(initialState);
+    console.log('Result:', JSON.stringify(result, null, 2));
+}
+
+// Run the test
+runSimpleTest().catch(console.error); 
\ No newline at end of file