import { spawnSync } from 'node:child_process';

describe('Functional tests for the cli version', () => {
	test('check the version is 11 series', () => {
		const result = spawnSync('node', [
			'dist/cli.js', 'apim', '-v'
		], { encoding: 'utf-8' });

		expect(result.stdout.trim()).toContain('11.1.4');

	});

	test('check the version is 12.0.0 with --version', () => {
		const result = spawnSync('node', [
			'dist/cli.js', 'apim', '--version'
		], { encoding: 'utf-8' });

		expect(result.stdout.trim()).toContain('11.1.4');

	});
});