reading version from package.json instead of version file #5

This commit is contained in:
undergroundwires
2020-04-26 14:38:16 +01:00
parent 226074c534
commit 691f989682
10 changed files with 12 additions and 13 deletions

View File

@@ -11,7 +11,7 @@ describe('Application', () => {
new ScriptStub('S3').withIsRecommended(true),
new ScriptStub('S4').withIsRecommended(true),
];
const sut = new Application('name', 'repo', 2, [
const sut = new Application('name', 'repo', '0.1.0', [
new CategoryStub(3).withScripts(expected[0], new ScriptStub('S1').withIsRecommended(false)),
new CategoryStub(2).withScripts(expected[1], new ScriptStub('S2').withIsRecommended(false)),
]);
@@ -28,7 +28,7 @@ describe('Application', () => {
const categories = [];
// act
function construct() { return new Application('name', 'repo', 2, categories); }
function construct() { return new Application('name', 'repo', '0.1.0', categories); }
// assert
expect(construct).to.throw('Application must consist of at least one category');
@@ -41,7 +41,7 @@ describe('Application', () => {
];
// act
function construct() { return new Application('name', 'repo', 2, categories); }
function construct() { return new Application('name', 'repo', '0.1.0', categories); }
// assert
expect(construct).to.throw('Application must consist of at least one script');
@@ -54,7 +54,7 @@ describe('Application', () => {
];
// act
function construct() { return new Application('name', 'repo', 2, categories); }
function construct() { return new Application('name', 'repo', '0.1.0', categories); }
// assert
expect(construct).to.throw('Application must consist of at least one recommended script');

View File

@@ -5,7 +5,7 @@ export class ApplicationStub implements IApplication {
public readonly totalCategories = 0;
public readonly name = 'StubApplication';
public readonly repositoryUrl = 'https://privacy.sexy';
public readonly version = 1;
public readonly version = '0.1.0';
public readonly categories = new Array<ICategory>();
public withCategory(category: ICategory): IApplication {