Files
TREK/server/tests/unit/app-config/running-version.test.ts
T
Maurice 2c3fb15263 style(server): format the files the health lanes added or moved
Prettier on every new or moved file that was not formatted, so lint:format
holds them; the files taken off the format baseline are the ones that moved
or were formatted on the way.
2026-10-10 20:16:04 +02:00

27 lines
794 B
TypeScript

import pkg from '../../../package.json';
import { runningVersion } from '../../../src/app-config';
import { hostVersion } from '../../../src/nest/plugins/install/host-compat';
import { afterEach, describe, expect, it, vi } from 'vitest';
afterEach(() => {
vi.unstubAllEnvs();
});
describe('runningVersion', () => {
it('announces APP_VERSION when it is set', () => {
vi.stubEnv('APP_VERSION', '9.8.7');
expect(runningVersion()).toBe('9.8.7');
});
it('falls back to the server package version', () => {
vi.stubEnv('APP_VERSION', '');
expect(runningVersion()).toBe(pkg.version);
});
it('is what the plugin host-compatibility checks call the host version', () => {
vi.stubEnv('APP_VERSION', '1.2.3');
expect(hostVersion()).toBe(runningVersion());
});
});