fix: remove confusing logs when searching for releases to add to a channel

This commit is contained in:
Pierre Vanduynslager
2018-12-17 15:23:04 -05:00
parent 9a04e64fab
commit 162b4b9e3b
4 changed files with 11 additions and 28 deletions
-13
View File
@@ -1,13 +1,6 @@
import test from 'ava';
import {stub} from 'sinon';
import getLastRelease from '../lib/get-last-release';
test.beforeEach(t => {
// Stub the logger functions
t.context.log = stub();
t.context.logger = {log: t.context.log};
});
test('Get the highest non-prerelease valid tag', t => {
const result = getLastRelease({
branch: {
@@ -20,11 +13,9 @@ test('Get the highest non-prerelease valid tag', t => {
type: 'release',
},
options: {tagFormat: `v\${version}`},
logger: t.context.logger,
});
t.deepEqual(result, {version: '2.0.0', gitTag: 'v2.0.0', name: 'v2.0.0', gitHead: '222', channel: undefined});
t.deepEqual(t.context.log.args[0][0], 'Found git tag v2.0.0 associated with version 2.0.0 on branch master');
});
test('Return empty object if no valid tag is found', t => {
@@ -35,11 +26,9 @@ test('Return empty object if no valid tag is found', t => {
type: 'release',
},
options: {tagFormat: `v\${version}`},
logger: t.context.logger,
});
t.deepEqual(result, {});
t.deepEqual(t.context.log.args[0][0], 'No git tag version found on branch master');
});
test('Get the highest non-prerelease valid tag before a certain version', t => {
@@ -58,11 +47,9 @@ test('Get the highest non-prerelease valid tag before a certain version', t => {
type: 'release',
},
options: {tagFormat: `v\${version}`},
logger: t.context.logger,
},
{before: '2.1.0'}
);
t.deepEqual(result, {version: '2.0.0', gitTag: 'v2.0.0', name: 'v2.0.0', gitHead: '333', channel: undefined});
t.deepEqual(t.context.log.args[0][0], 'Found git tag v2.0.0 associated with version 2.0.0 on branch master');
});
-12
View File
@@ -1,13 +1,6 @@
import test from 'ava';
import {stub} from 'sinon';
import getReleasesToAdd from '../lib/get-releases-to-add';
test.beforeEach(t => {
// Stub the logger functions
t.context.log = stub();
t.context.logger = {log: t.context.log};
});
test('Return versions merged from release to maintenance branch', t => {
const result = getReleasesToAdd({
branch: {
@@ -22,7 +15,6 @@ test('Return versions merged from release to maintenance branch', t => {
},
branches: [{name: '1.x', channel: '1.x'}, {name: 'master'}],
options: {tagFormat: `v\${version}`},
logger: t.context.logger,
});
t.deepEqual(result, [
@@ -80,7 +72,6 @@ test('Return versions merged from future branch to release branch', t => {
},
branches: [{name: 'master'}, {name: 'next', channel: 'next'}, {name: 'next-major', channel: 'next-major'}],
options: {tagFormat: `v\${version}`},
logger: t.context.logger,
});
t.deepEqual(result, [
@@ -138,7 +129,6 @@ test('Return releases sorted by ascending order', t => {
},
branches: [{name: 'master'}, {name: 'next', channel: 'next'}, {name: 'next-major', channel: 'next-major'}],
options: {tagFormat: `v\${version}`},
logger: t.context.logger,
});
t.deepEqual(result, [
@@ -188,7 +178,6 @@ test('no lastRelease', t => {
branch: {name: 'master', tags: [{gitTag: 'v1.0.0@next', version: '1.0.0', channel: 'next', gitHead: '111'}]},
branches: [{name: 'master'}, {name: 'next', channel: 'next'}],
options: {tagFormat: `v\${version}`},
logger: t.context.logger,
});
t.deepEqual(result, [
@@ -231,7 +220,6 @@ test('Ignore pre-release versions', t => {
{name: 'alpha', type: 'prerelease', channel: 'alpha'},
],
options: {tagFormat: `v\${version}`},
logger: t.context.logger,
});
t.deepEqual(result, [