ui/fix linting error and failing ui test (#15953)

* fix linting error

* Fix the failing version test as well
This commit is contained in:
Chris Hut 2023-01-11 10:48:04 -07:00 committed by GitHub
parent 797bfb1677
commit ad123d9564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 10 deletions

View File

@ -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 ($) {

View File

@ -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();
});