style: prettier formatting
This commit is contained in:
@@ -171,7 +171,10 @@ test('Throw SemanticReleaseError for invalid configurations', async t => {
|
||||
});
|
||||
|
||||
test('Throw a SemanticReleaseError if there is duplicate branches', async t => {
|
||||
const branches = [{name: 'master', tags: []}, {name: 'master', tags: []}];
|
||||
const branches = [
|
||||
{name: 'master', tags: []},
|
||||
{name: 'master', tags: []},
|
||||
];
|
||||
const getBranches = proxyquire('../../lib/branches', {'./get-tags': () => branches, './expand': () => []});
|
||||
|
||||
const errors = [...(await t.throwsAsync(getBranches('repositoryUrl', {options: {branches}})))];
|
||||
@@ -183,7 +186,10 @@ test('Throw a SemanticReleaseError if there is duplicate branches', async t => {
|
||||
});
|
||||
|
||||
test('Throw a SemanticReleaseError for each invalid branch name', async t => {
|
||||
const branches = [{name: '~master', tags: []}, {name: '^master', tags: []}];
|
||||
const branches = [
|
||||
{name: '~master', tags: []},
|
||||
{name: '^master', tags: []},
|
||||
];
|
||||
const getBranches = proxyquire('../../lib/branches', {'./get-tags': () => branches, './expand': () => []});
|
||||
|
||||
const errors = [...(await t.throwsAsync(getBranches('repositoryUrl', {options: {branches}})))];
|
||||
|
||||
@@ -129,7 +129,10 @@ test('Return branches with and empty tags array if no valid tag is found in hist
|
||||
|
||||
const result = await getTags({cwd, options: {tagFormat: `prefix@v\${version}`}}, [{name: 'master'}, {name: 'next'}]);
|
||||
|
||||
t.deepEqual(result, [{name: 'master', tags: []}, {name: 'next', tags: []}]);
|
||||
t.deepEqual(result, [
|
||||
{name: 'master', tags: []},
|
||||
{name: 'next', tags: []},
|
||||
]);
|
||||
});
|
||||
|
||||
test('Get the highest valid tag corresponding to the "tagFormat"', async t => {
|
||||
|
||||
@@ -4,7 +4,11 @@ import normalize from '../../lib/branches/normalize';
|
||||
const toTags = versions => versions.map(version => ({version}));
|
||||
|
||||
test('Maintenance branches - initial state', t => {
|
||||
const maintenance = [{name: '1.x', channel: '1.x', tags: []}, {name: '1.1.x', tags: []}, {name: '1.2.x', tags: []}];
|
||||
const maintenance = [
|
||||
{name: '1.x', channel: '1.x', tags: []},
|
||||
{name: '1.1.x', tags: []},
|
||||
{name: '1.2.x', tags: []},
|
||||
];
|
||||
const release = [{name: 'master', tags: []}];
|
||||
t.deepEqual(
|
||||
normalize.maintenance({maintenance, release}).map(({type, name, range, accept, channel, mergeRange}) => ({
|
||||
@@ -303,24 +307,35 @@ test('Prerelease branches', t => {
|
||||
{name: 'alpha', prerelease: 'preview', tags: []},
|
||||
];
|
||||
|
||||
t.deepEqual(normalize.prerelease({prerelease}).map(({type, name, channel}) => ({type, name, channel})), [
|
||||
{type: 'prerelease', name: 'beta', channel: 'beta'},
|
||||
{type: 'prerelease', name: 'alpha', channel: 'alpha'},
|
||||
]);
|
||||
t.deepEqual(
|
||||
normalize.prerelease({prerelease}).map(({type, name, channel}) => ({type, name, channel})),
|
||||
[
|
||||
{type: 'prerelease', name: 'beta', channel: 'beta'},
|
||||
{type: 'prerelease', name: 'alpha', channel: 'alpha'},
|
||||
]
|
||||
);
|
||||
});
|
||||
|
||||
test('Allow to set channel to "false" to prevent default', t => {
|
||||
const maintenance = [{name: '1.x', channel: false, tags: []}];
|
||||
const release = [{name: 'master', channel: false, tags: []}, {name: 'next', channel: false, tags: []}];
|
||||
const release = [
|
||||
{name: 'master', channel: false, tags: []},
|
||||
{name: 'next', channel: false, tags: []},
|
||||
];
|
||||
const prerelease = [{name: 'beta', channel: false, prerelease: true, tags: []}];
|
||||
t.deepEqual(normalize.maintenance({maintenance, release}).map(({name, channel}) => ({name, channel})), [
|
||||
{name: '1.x', channel: false},
|
||||
]);
|
||||
t.deepEqual(normalize.release({release}).map(({name, channel}) => ({name, channel})), [
|
||||
{name: 'master', channel: false},
|
||||
{name: 'next', channel: false},
|
||||
]);
|
||||
t.deepEqual(normalize.prerelease({prerelease}).map(({name, channel}) => ({name, channel})), [
|
||||
{name: 'beta', channel: false},
|
||||
]);
|
||||
t.deepEqual(
|
||||
normalize.maintenance({maintenance, release}).map(({name, channel}) => ({name, channel})),
|
||||
[{name: '1.x', channel: false}]
|
||||
);
|
||||
t.deepEqual(
|
||||
normalize.release({release}).map(({name, channel}) => ({name, channel})),
|
||||
[
|
||||
{name: 'master', channel: false},
|
||||
{name: 'next', channel: false},
|
||||
]
|
||||
);
|
||||
t.deepEqual(
|
||||
normalize.prerelease({prerelease}).map(({name, channel}) => ({name, channel})),
|
||||
[{name: 'beta', channel: false}]
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user