2020-08-04 16:59:55 +03:00
|
|
|
require('./utils');
|
|
|
|
|
2020-08-11 18:34:35 +03:00
|
|
|
const fs = require('fs');
|
2020-08-04 16:59:55 +03:00
|
|
|
const path = require('path');
|
|
|
|
const {Changelog} = require('../lib');
|
|
|
|
|
|
|
|
describe('Changelog', function () {
|
|
|
|
it('can generate changelog.md', function () {
|
2020-08-11 18:34:35 +03:00
|
|
|
const changelogPath = path.join(process.cwd(), 'changelog.md');
|
|
|
|
|
2020-08-04 16:59:55 +03:00
|
|
|
const changelog = new Changelog({
|
2020-08-11 18:34:35 +03:00
|
|
|
changelogPath: changelogPath,
|
2020-08-04 16:59:55 +03:00
|
|
|
folder: process.cwd()
|
|
|
|
});
|
|
|
|
|
|
|
|
changelog
|
|
|
|
.write({
|
|
|
|
githubRepoPath: `https://github.com/TryGhost/Ghost-Utils`,
|
|
|
|
lastVersion: '@tryghost/release-utils@0.6.3'
|
|
|
|
})
|
|
|
|
.sort()
|
|
|
|
.clean();
|
2020-08-11 18:34:35 +03:00
|
|
|
|
|
|
|
try {
|
|
|
|
fs.unlinkSync(changelogPath);
|
|
|
|
fs.unlinkSync(changelogPath + '.bk');
|
|
|
|
} catch (err) {
|
|
|
|
should.not.exist(err);
|
|
|
|
}
|
2020-08-04 16:59:55 +03:00
|
|
|
});
|
|
|
|
});
|