mirror of
https://github.com/immich-app/immich.git
synced 2025-12-27 01:11:42 +03:00
30 lines
875 B
TypeScript
30 lines
875 B
TypeScript
|
|
import { readFileSync } from 'node:fs';
|
||
|
|
import { apiUtils, immichCli } from 'src/utils';
|
||
|
|
import { beforeAll, describe, expect, it } from 'vitest';
|
||
|
|
|
||
|
|
const pkg = JSON.parse(readFileSync('../cli/package.json', 'utf8'));
|
||
|
|
|
||
|
|
describe(`immich --version`, () => {
|
||
|
|
beforeAll(() => {
|
||
|
|
apiUtils.setup();
|
||
|
|
});
|
||
|
|
|
||
|
|
describe('immich --version', () => {
|
||
|
|
it('should print the cli version', async () => {
|
||
|
|
const { stdout, stderr, exitCode } = await immichCli(['--version']);
|
||
|
|
expect(stdout).toEqual(pkg.version);
|
||
|
|
expect(stderr).toEqual('');
|
||
|
|
expect(exitCode).toBe(0);
|
||
|
|
});
|
||
|
|
});
|
||
|
|
|
||
|
|
describe('immich -V', () => {
|
||
|
|
it('should print the cli version', async () => {
|
||
|
|
const { stdout, stderr, exitCode } = await immichCli(['-V']);
|
||
|
|
expect(stdout).toEqual(pkg.version);
|
||
|
|
expect(stderr).toEqual('');
|
||
|
|
expect(exitCode).toBe(0);
|
||
|
|
});
|
||
|
|
});
|
||
|
|
});
|