Skip to content

Commit

Permalink
fix: create release using gitlab recommended api
Browse files Browse the repository at this point in the history
  • Loading branch information
Sassoun Derderian committed Mar 26, 2020
1 parent a49e45d commit 36f055a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/conventional-gitlab-releaser/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ function conventionalGitlabReleaser (auth, changelogOpts, context, gitRawCommits
return
}

const url = `/projects/${escape(context.owner + `/` + context.repository)}/repository/tags/${chunk.keyCommit.version}/release`
const url = `/projects/${escape(context.owner + `/` + context.repository)}/releases`
const options = {
endpoint: auth.url,
body: {
tag_name: chunk.keyCommit.version,
description: chunk.log
}
}
Expand Down
37 changes: 37 additions & 0 deletions packages/conventional-gitlab-releaser/src/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
'use strict'

const chai = require('chai')
const mocha = require(`mocha`)
const conventionalGitlabReleaser = require('./index')

const expect = chai.expect

const beforeEach = mocha.beforeEach
const describe = mocha.describe
const it = mocha.it

describe.only('index', function () {
beforeEach(function () {
this.chunk = {
committerDate: 'June 8, 2012',
gitTags: ''
}
})

it('should throw an error if no argument is passed', function () {
expect(conventionalGitlabReleaser).to.throw()
})

it('should throw an error if no user callback is passed', function () {
expect(function () {
conventionalGitlabReleaser({}, {}, {}, {}, {})
}).to.throw()
})

it('should not throw if userCb is a callback function', function () {
const userCb = function () {}
expect(function () {
conventionalGitlabReleaser({}, {}, {}, {}, {}, userCb)
}).not.to.throw()
})
})

0 comments on commit 36f055a

Please sign in to comment.