Skip to content

Commit

Permalink
check that latest version appears in changelog (#9071)
Browse files Browse the repository at this point in the history
This prevents an update to package.json from being merged without
including a corresponding change to the changelog.

This will prevent me from forgetting to remove `-beta` from the
changelog when doing a final release.
  • Loading branch information
ansis authored Dec 5, 2019
1 parent 18e2446 commit 6c87ac7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/unit/changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {test} from '../util/test';
import fs from 'fs';
import path from 'path';
import {version} from '../../package.json';

test('changelog', (t) => {
const changelog = fs.readFileSync(path.join(__dirname, '../../CHANGELOG.md'), 'utf8');
t.test('latest version is in changelog', (t) => {
if (version.indexOf('-dev') <= 0) {
const versionString = `## ${version}\n`;
t.ok(changelog.indexOf(versionString) >= 0);
}
t.end();
});

t.end();
});

0 comments on commit 6c87ac7

Please sign in to comment.