mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-24 07:46:41 +00:00
e1e35eb83b
We are refactoring the supervisor test suite into unit tests (for algorithms an domain model tests) and integration tests (for interaction with out-of-process dependencies). This means the current test suite needs to be classified into these two categories, and fixed whenever possible. This commit moves the test suite under the `test/legacy` folder, this folder should be progressively migrated and eventually removed. Subsequent commits will begin to split these files into unit and integration whenever possible. Depends-on: #1996 Change-type: patch
36 lines
876 B
TypeScript
36 lines
876 B
TypeScript
import { expect } from 'chai';
|
|
|
|
import * as osRelease from '~/lib/os-release';
|
|
|
|
const OS_RELEASE_PATH = 'test/data/etc/os-release-tx2';
|
|
|
|
describe('OS Release Information', () => {
|
|
it('gets pretty name', async () => {
|
|
// Try to get PRETTY_NAME
|
|
await expect(osRelease.getOSVersion(OS_RELEASE_PATH)).to.eventually.equal(
|
|
'balenaOS 2.45.1+rev3',
|
|
);
|
|
});
|
|
|
|
it('gets variant', async () => {
|
|
// Try to get VARIANT_ID
|
|
await expect(osRelease.getOSVariant(OS_RELEASE_PATH)).to.eventually.equal(
|
|
'prod',
|
|
);
|
|
});
|
|
|
|
it('gets version', async () => {
|
|
// Try to get VERSION
|
|
await expect(osRelease.getOSSemver(OS_RELEASE_PATH)).to.eventually.equal(
|
|
'2.45.1+rev3',
|
|
);
|
|
});
|
|
|
|
it('gets meta release version', async () => {
|
|
// Try to get META_BALENA_VERSIONS
|
|
await expect(
|
|
osRelease.getMetaOSRelease(OS_RELEASE_PATH),
|
|
).to.eventually.equal('2.45.1');
|
|
});
|
|
});
|