MCPcopy Create free account
hub / github.com/deepclause/agentvm / test

Function test

test-nested.js:3–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1const { AgentVM } = require('./src/index');
2
3async function test() {
4 const vm = new AgentVM({
5 mounts: { '/mnt/data': './test-mount' }
6 });
7 await vm.start();
8
9 console.log('Test 1: ls /mnt/data (top level)...');
10 let res = await vm.exec('ls /mnt/data');
11 console.log('Result:', res.stdout);
12
13 console.log('\nTest 2: ls /mnt/data/downloads (1 level nested)...');
14 res = await vm.exec('ls /mnt/data/downloads');
15 console.log('Result:', res.stdout);
16
17 console.log('\nTest 3: ls /mnt/data/downloads/subdir (2 levels nested)...');
18 res = await vm.exec('ls /mnt/data/downloads/subdir');
19 console.log('Result:', res);
20
21 console.log('\nTest 4: cat a nested file...');
22 res = await vm.exec('cat /mnt/data/downloads/test-download.txt');
23 console.log('Result:', res);
24
25 await vm.stop();
26}
27test().catch(e => { console.error('Error:', e); process.exit(1); });

Callers 1

test-nested.jsFile · 0.70

Calls 3

startMethod · 0.95
execMethod · 0.95
stopMethod · 0.95

Tested by

no test coverage detected