Files
lobster/test/tool_envelope_version.test.ts
T

17 lines
533 B
TypeScript

import test from 'node:test';
import assert from 'node:assert/strict';
import { spawnSync } from 'node:child_process';
import path from 'node:path';
test('tool mode outputs protocolVersion', () => {
const bin = path.join(process.cwd(), 'bin', 'lobster.js');
const res = spawnSync('node', [bin, 'run', '--mode', 'tool', "exec --json --shell 'echo [1]'"], {
encoding: 'utf8',
});
assert.equal(res.status, 0);
const out = JSON.parse(res.stdout);
assert.equal(out.protocolVersion, 1);
assert.equal(out.ok, true);
});