cloudcmd/bin/cloudcmd.spec.js
2026-03-29 17:00:48 +03:00

27 lines
625 B
JavaScript

import {spawnSync} from 'node:child_process';
import {test} from 'supertape';
const cliPath = new URL('cloudcmd.js', import.meta.url).pathname;
import info from '../package.json' with {
type: 'json',
}
test('cloudcmd: bin: cli: -h', (t) => {
const {version} = info;
const {stdout} = spawnSync(cliPath, ['-h'], {
encoding: 'utf8',
});
t.match(stdout, `Options`);
t.end();
});
test('cloudcmd: bin: cli: -v', (t) => {
const {version} = info;
const {stdout} = spawnSync(cliPath, ['-v'], {
encoding: 'utf8',
});
t.match(stdout, `v${version}`);
t.end();
});