mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 04:22:01 +00:00
[tests] Remove old changelog tests (#11420)
These tests are remnants for code deleted in https://github.com/vercel/vercel/pull/9914.
This commit is contained in:
2
.changeset/early-spoons-add.md
Normal file
2
.changeset/early-spoons-add.md
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
---
|
||||
@@ -1,138 +0,0 @@
|
||||
const filterLog = require('../../../utils/changelog/filter');
|
||||
|
||||
describe('changelog', () => {
|
||||
describe('filter', () => {
|
||||
it('should remove "Publish" commits', async () => {
|
||||
const commits = [
|
||||
{
|
||||
areas: ['cli'],
|
||||
hash: '073f353fcf1944633bb43119c8ffcff46eea0480',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'[cli] Add "outDir" to `tsconfig.json` (#6566) [Nathan Rajlich]',
|
||||
},
|
||||
{
|
||||
areas: ['UNCATEGORIZED'],
|
||||
hash: 'a1787c740de0d9004e11f7666b6014f820d3c523',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject: 'Publish Stable [Nathan Rajlich]',
|
||||
},
|
||||
];
|
||||
|
||||
let filteredCommits = filterLog(commits);
|
||||
expect(filteredCommits).toEqual([
|
||||
{
|
||||
areas: ['cli'],
|
||||
hash: '073f353fcf1944633bb43119c8ffcff46eea0480',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'[cli] Add "outDir" to `tsconfig.json` (#6566) [Nathan Rajlich]',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('should remove "Revert" and the revertted commits', async () => {
|
||||
const commits = [
|
||||
{
|
||||
areas: ['cli'],
|
||||
hash: '073f353fcf1944633bb43119c8ffcff46eea0480',
|
||||
message:
|
||||
'This reverts commit 17fd88e044a807adf4ee6ed662cdb7c7556e912d.',
|
||||
revertsHashes: ['17fd88e044a807adf4ee6ed662cdb7c7556e912d'],
|
||||
subject:
|
||||
'Revert "[cli] Add "outDir" to `tsconfig.json` (#6566) [Nathan Rajlich]"',
|
||||
},
|
||||
{
|
||||
areas: ['frameworks', 'cli'],
|
||||
hash: '17fd88e044a807adf4ee6ed662cdb7c7556e912d',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'[frameworks][cli] Disable blank issues again [Leo Lamprecht]',
|
||||
},
|
||||
{
|
||||
areas: ['UNCATEGORIZED'],
|
||||
hash: 'a1787c740de0d9004e11f7666b6014f820d3c523',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054) [Andy]',
|
||||
},
|
||||
];
|
||||
|
||||
let filteredCommits = filterLog(commits);
|
||||
expect(filteredCommits).toEqual([
|
||||
{
|
||||
areas: ['UNCATEGORIZED'],
|
||||
hash: 'a1787c740de0d9004e11f7666b6014f820d3c523',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054) [Andy]',
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
it('should NOT remove "Revert" if the reverted commit is not in the current changelog entry', async () => {
|
||||
const commits = [
|
||||
{
|
||||
areas: ['cli'],
|
||||
hash: '073f353fcf1944633bb43119c8ffcff46eea0480',
|
||||
message:
|
||||
'This reverts commit 17fd88e044a807adf4ee6ed662cdb7c7556e912d.',
|
||||
revertsHashes: ['17fd88e044a807adf4ee6ed662cdb7c7556e912d'],
|
||||
subject:
|
||||
'Revert "[cli] Add "outDir" to `tsconfig.json` (#6566) [Nathan Rajlich]"',
|
||||
},
|
||||
{
|
||||
areas: ['frameworks', 'cli'],
|
||||
hash: '29a44db8d9377d7f16146817aded57ebfbcff752',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'[frameworks][cli] Disable blank issues again [Leo Lamprecht]',
|
||||
},
|
||||
{
|
||||
areas: ['UNCATEGORIZED'],
|
||||
hash: 'a1787c740de0d9004e11f7666b6014f820d3c523',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054) [Andy]',
|
||||
},
|
||||
];
|
||||
|
||||
let filteredCommits = filterLog(commits);
|
||||
expect(filteredCommits).toEqual([
|
||||
{
|
||||
areas: ['cli'],
|
||||
hash: '073f353fcf1944633bb43119c8ffcff46eea0480',
|
||||
message:
|
||||
'This reverts commit 17fd88e044a807adf4ee6ed662cdb7c7556e912d.',
|
||||
revertsHashes: ['17fd88e044a807adf4ee6ed662cdb7c7556e912d'],
|
||||
subject:
|
||||
'Revert "[cli] Add "outDir" to `tsconfig.json` (#6566) [Nathan Rajlich]"',
|
||||
},
|
||||
{
|
||||
areas: ['frameworks', 'cli'],
|
||||
hash: '29a44db8d9377d7f16146817aded57ebfbcff752',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'[frameworks][cli] Disable blank issues again [Leo Lamprecht]',
|
||||
},
|
||||
{
|
||||
areas: ['UNCATEGORIZED'],
|
||||
hash: 'a1787c740de0d9004e11f7666b6014f820d3c523',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054) [Andy]',
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,49 +0,0 @@
|
||||
const groupLog = require('../../../utils/changelog/group');
|
||||
|
||||
describe('changelog', () => {
|
||||
describe('group', () => {
|
||||
const commits = [
|
||||
{
|
||||
areas: ['cli'],
|
||||
hash: '073f353fcf1944633bb43119c8ffcff46eea0480',
|
||||
message:
|
||||
'This reverts commit 17fd88e044a807adf4ee6ed662cdb7c7556e912d.',
|
||||
revertsHashes: ['17fd88e044a807adf4ee6ed662cdb7c7556e912d'],
|
||||
subject:
|
||||
'[cli] Add "outDir" to `tsconfig.json` (#6566) [Nathan Rajlich]',
|
||||
},
|
||||
{
|
||||
areas: ['frameworks', 'cli'],
|
||||
hash: '17fd88e044a807adf4ee6ed662cdb7c7556e912d',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject: '[frameworks][cli] Disable blank issues again [Leo Lamprecht]',
|
||||
},
|
||||
{
|
||||
areas: ['UNCATEGORIZED'],
|
||||
hash: 'a1787c740de0d9004e11f7666b6014f820d3c523',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054) [Andy]',
|
||||
},
|
||||
];
|
||||
|
||||
it('should group commits by area', async () => {
|
||||
let groupedLogLines = groupLog(commits);
|
||||
|
||||
expect(groupedLogLines).toEqual({
|
||||
UNCATEGORIZED: [
|
||||
'Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054) [Andy]',
|
||||
],
|
||||
frameworks: [
|
||||
'[frameworks][cli] Disable blank issues again [Leo Lamprecht]',
|
||||
],
|
||||
cli: [
|
||||
'[cli] Add "outDir" to `tsconfig.json` (#6566) [Nathan Rajlich]',
|
||||
'[frameworks][cli] Disable blank issues again [Leo Lamprecht]',
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,51 +0,0 @@
|
||||
const childProcess = require('child_process');
|
||||
|
||||
const parseCommits = require('../../../utils/changelog/parse');
|
||||
|
||||
jest.mock('child_process');
|
||||
|
||||
describe('changelog', () => {
|
||||
describe('parse', () => {
|
||||
const logLines = [
|
||||
'[cli] Add "outDir" to `tsconfig.json` (#6566) [Nathan Rajlich] &&& 073f353fcf1944633bb43119c8ffcff46eea0480',
|
||||
'[frameworks][cli] Disable blank issues again [Leo Lamprecht] &&& 17fd88e044a807adf4ee6ed662cdb7c7556e912d',
|
||||
'Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054) [Andy] &&& a1787c740de0d9004e11f7666b6014f820d3c523',
|
||||
];
|
||||
|
||||
it('should group commits by area', async () => {
|
||||
childProcess.execSync.mockReturnValue(`does some work`);
|
||||
childProcess.execSync.mockReturnValueOnce(
|
||||
`This reverts commit 17fd88e044a807adf4ee6ed662cdb7c7556e912d.`
|
||||
);
|
||||
|
||||
let commits = parseCommits(logLines);
|
||||
expect(commits).toEqual([
|
||||
{
|
||||
areas: ['cli'],
|
||||
hash: '073f353fcf1944633bb43119c8ffcff46eea0480',
|
||||
message:
|
||||
'This reverts commit 17fd88e044a807adf4ee6ed662cdb7c7556e912d.',
|
||||
revertsHashes: ['17fd88e044a807adf4ee6ed662cdb7c7556e912d'],
|
||||
subject:
|
||||
'[cli] Add "outDir" to `tsconfig.json` (#6566) [Nathan Rajlich]',
|
||||
},
|
||||
{
|
||||
areas: ['frameworks', 'cli'],
|
||||
hash: '17fd88e044a807adf4ee6ed662cdb7c7556e912d',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'[frameworks][cli] Disable blank issues again [Leo Lamprecht]',
|
||||
},
|
||||
{
|
||||
areas: ['UNCATEGORIZED'],
|
||||
hash: 'a1787c740de0d9004e11f7666b6014f820d3c523',
|
||||
message: 'does some work',
|
||||
revertsHashes: [],
|
||||
subject:
|
||||
'Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054) [Andy]',
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user