mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-20 05:56:53 +00:00
2c3fb15263
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.
27 lines
794 B
TypeScript
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());
|
|
});
|
|
});
|