Ghost/ghost/release-utils/test/releases.test.js
Katharina Irrgang 3cb6042b10 Added initial implementation of @tryghost/release-utils (#7)
- Added the first version of release-utils
- Will release a v0.0.1

- Be able to create changelog.md based on previous version.
- Be able to merge & clean changelog.md.
- Be able to create a gist
- Be able to filter commits by emojis (user-facing changes)
- Be able to create a draft release
- Be able to upload a release zip to Github

The goal is to use our release-utils in multiple places (e.g. in Casper).

We will discuss if we want to replace some of our manual written utilities by existing npm packages. But to avoid breaking everything, we do it iteratively. Our release utils works and was designed based on our needs. We've tested some release utility in the past, they were all not really satisfying. TBC...
2019-03-12 21:53:32 +01:00

32 lines
960 B
JavaScript

// Switch these lines once there are useful utils
// const testUtils = require('./utils');
require('./utils');
const lib = require('../lib');
describe('Releases', function () {
describe('uploadZip', function () {
it('no options', function (done) {
try {
lib.releases.uploadZip();
} catch (err) {
err.message.should.eql('Missing options: zipPath, github, github.username, github.token, userAgent, uri');
return done();
}
throw new Error('should fail');
});
it('missing options', function (done) {
try {
lib.releases.uploadZip({zipPath: 'test', github: {username: 'test'}});
} catch (err) {
err.message.should.eql('Missing options: github.token, userAgent, uri');
return done();
}
throw new Error('should fail');
});
});
});