Refactor to use version object #59

Enable writing safer version aware logic.
This commit is contained in:
undergroundwires
2022-02-26 17:15:30 +01:00
parent d6bc33ec86
commit eeb1d5b0c4
14 changed files with 198 additions and 35 deletions

View File

@@ -1,6 +1,6 @@
export function getProcessEnvironmentStub(): NodeJS.ProcessEnv {
return {
VUE_APP_VERSION: 'stub-version',
VUE_APP_VERSION: '0.11.3',
VUE_APP_NAME: 'stub-name',
VUE_APP_REPOSITORY_URL: 'stub-repository-url',
VUE_APP_HOMEPAGE_URL: 'stub-homepage-url',

View File

@@ -1,9 +1,11 @@
import { IProjectInformation } from '@/domain/IProjectInformation';
import { Version } from '@/domain/Version';
import { VersionStub } from './VersionStub';
export class ProjectInformationStub implements IProjectInformation {
public name = 'name';
public version = 'version';
public version = new VersionStub();
public repositoryUrl = 'repositoryUrl';
@@ -22,7 +24,7 @@ export class ProjectInformationStub implements IProjectInformation {
return this;
}
public withVersion(version: string): ProjectInformationStub {
public withVersion(version: Version): ProjectInformationStub {
this.version = version;
return this;
}

View File

@@ -0,0 +1,7 @@
import { Version } from '@/domain/Version';
export class VersionStub extends Version {
constructor(version?: string) {
super(version ?? '0.10.0');
}
}