mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Store the server version on start
This commit is contained in:
17
test/unit/init/ModuleVersionVerifier.test.ts
Normal file
17
test/unit/init/ModuleVersionVerifier.test.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ModuleVersionVerifier } from '../../../src/init/ModuleVersionVerifier';
|
||||
|
||||
describe('A ModuleVersionVerifier', (): void => {
|
||||
const storageKey = 'uniqueVersionKey';
|
||||
let storageMap: Map<string, string>;
|
||||
let initializer: ModuleVersionVerifier;
|
||||
|
||||
beforeEach(async(): Promise<void> => {
|
||||
storageMap = new Map<string, string>();
|
||||
initializer = new ModuleVersionVerifier(storageKey, storageMap as any);
|
||||
});
|
||||
|
||||
it('stores the latest version.', async(): Promise<void> => {
|
||||
await expect(initializer.handle()).resolves.toBeUndefined();
|
||||
expect(storageMap.get(storageKey)).toMatch(/^\d+\.\d+\.\d+(?:-.+)?/u);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user