From 817a4a03b689560a278349e712cd789fc7ee5dc6 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Tue, 5 Mar 2019 12:56:19 +0200 Subject: [PATCH] add versions to test args and version getters to config --- core/src/main.js | 14 +++++++++++++- core/src/modules/config.js | 10 +++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/core/src/main.js b/core/src/main.js index 4fade163..f1e726cc 100644 --- a/core/src/main.js +++ b/core/src/main.js @@ -11,8 +11,20 @@ const TESTS = typeof PRODUCTION === 'undefined'; const TEST_ARGS = () => { const _basePath = path.resolve(__dirname, '..', '..'); - const _baseDataPath = path.resolve(_basePath, 'tests'); + const _baseDataPath = path.resolve(_basePath, 'tests'); + + const _corePkg = require(path.resolve(_basePath, 'core', 'package.json')); + const _clientPkg = require(path.resolve(_basePath, 'client', 'package.json')); + const _editorPkg = require(path.resolve(_basePath, 'editor', 'package.json')); + + const coreVersion = _corePkg.version; + const clientVersion = _clientPkg.version; + const editorVersion = _editorPkg.version; + return { + coreVersion, + clientVersion, + editorVersion, 'options': { 'autoInject': true, 'commonCore': true, diff --git a/core/src/modules/config.js b/core/src/modules/config.js index c81ba5de..91bc713d 100644 --- a/core/src/modules/config.js +++ b/core/src/modules/config.js @@ -16,8 +16,16 @@ export default class Config extends Module { return this.args.version; } + get coreVersion() { + return this.state.coreVersion; + } + get clientVersion() { - return this.args.clientVersion; + return this.state.clientVersion; + } + + get editorVersion() { + return this.state.editorVersion; } setClientVersion(clientVersion) {