2019-03-12 23:53:32 +03:00
|
|
|
// 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) {
|
2020-04-01 14:00:19 +03:00
|
|
|
err.message.should.eql('Missing options: zipPath, github, github.token, userAgent, uri');
|
2019-03-12 23:53:32 +03:00
|
|
|
return done();
|
|
|
|
}
|
|
|
|
|
|
|
|
throw new Error('should fail');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('missing options', function (done) {
|
|
|
|
try {
|
2020-04-01 14:00:19 +03:00
|
|
|
lib.releases.uploadZip({zipPath: 'test', github: {}});
|
2019-03-12 23:53:32 +03:00
|
|
|
} catch (err) {
|
|
|
|
err.message.should.eql('Missing options: github.token, userAgent, uri');
|
|
|
|
return done();
|
|
|
|
}
|
|
|
|
|
|
|
|
throw new Error('should fail');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|