From cc45c3c044c419fad59ad1d5a320fb4e35780e62 Mon Sep 17 00:00:00 2001 From: Chris Hut Date: Wed, 11 Jan 2023 10:48:04 -0700 Subject: [PATCH] ui/fix linting error and failing ui test (#15953) * fix linting error * Fix the failing version test as well --- ui/packages/consul-ui/config/utils.js | 3 +-- ui/packages/consul-ui/node-tests/config/utils.js | 10 ++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/ui/packages/consul-ui/config/utils.js b/ui/packages/consul-ui/config/utils.js index 18ce415b91..6b3e24d708 100644 --- a/ui/packages/consul-ui/config/utils.js +++ b/ui/packages/consul-ui/config/utils.js @@ -11,8 +11,7 @@ const repositorySHA = function (sha = exec('git rev-parse --short HEAD')) { const binaryVersion = function (repositoryRoot) { return function (versionFileContents = read(`${repositoryRoot}/version/VERSION`)) { // see /scripts/dist.sh:8 - return versionFileContents - .toString() + return versionFileContents.toString(); }; }; const env = function ($) { diff --git a/ui/packages/consul-ui/node-tests/config/utils.js b/ui/packages/consul-ui/node-tests/config/utils.js index 243ac81fea..02505c6d7f 100644 --- a/ui/packages/consul-ui/node-tests/config/utils.js +++ b/ui/packages/consul-ui/node-tests/config/utils.js @@ -11,14 +11,8 @@ test('utils.respositoryYear parses the year out correctly', function (t) { t.end(); }); test('utils.binaryVersion parses the version out correctly', function (t) { - const expected = '1.9.0'; - const actual = utils.binaryVersion()(` - - Version = "1.9.0" - - VersionPrerelease = "dev" - -`); + const expected = '1.15.0-dev'; + const actual = utils.binaryVersion()(`1.15.0-dev`); t.equal(actual, expected, 'It parses the version correctly'); t.end(); });