mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
18 lines
636 B
TypeScript
18 lines
636 B
TypeScript
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);
|
|
});
|
|
});
|