Files
vercel/test/utils/changelog/group.test.js
Sean Massa 56960e506e [cli] enhance changelog accuracy and format (#7387)
* refactor and add test to changelog

* group changelog into areas

* remove revert and reverted commits from changelog

* make sure Revert commits that revert a commit in a previous changelog are not filtered

* run "yarn test" as part of "yarn test-unit"

* remove advanced syntax

* remove advanced syntax

* temp changelog

* remove temp changelog

* remove global jest config

* Delete symlink

* scope jest dir to just the test files we care about
2022-03-02 10:22:56 -08:00

50 lines
1.6 KiB
JavaScript

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]',
],
});
});
});
});