From 6c87ac798804cbd54a2b55687c1ad925aaec5ca0 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 5 Dec 2019 18:31:17 -0500 Subject: [PATCH] check that latest version appears in changelog (#9071) 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. --- test/unit/changelog.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/unit/changelog.js diff --git a/test/unit/changelog.js b/test/unit/changelog.js new file mode 100644 index 00000000000..1a7bc37536e --- /dev/null +++ b/test/unit/changelog.js @@ -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(); +});