Skip to content

Commit

Permalink
fix(package): update url-join to version 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkeeper[bot] authored and pvdlg committed Feb 2, 2018
1 parent 111e894 commit 9cf0a55
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"escape-string-regexp": "^1.0.5",
"got": "^8.0.1",
"parse-path": "^3.0.2",
"url-join": "^3.0.0"
"url-join": "^4.0.0"
},
"devDependencies": {
"ava": "^0.25.0",
Expand Down
21 changes: 19 additions & 2 deletions test/verify.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ test.serial('Verify token and repository access (group_access 40)', async t => {
t.true(gitlab.isDone());
});

test.serial('Verify token and repository access and custom URL', async t => {
test.serial('Verify token and repository access and custom URL with prefix', async t => {
const owner = 'test_user';
const repo = 'test_repo';
process.env.GL_TOKEN = 'gitlab_token';
Expand All @@ -101,6 +101,23 @@ test.serial('Verify token and repository access and custom URL', async t => {
t.deepEqual(t.context.log.args[0], ['Verify GitLab authentication (%s)', 'https://othertesturl.com:9090/prefix']);
});

test.serial('Verify token and repository access and custom URL without prefix', async t => {
const owner = 'test_user';
const repo = 'test_repo';
process.env.GL_TOKEN = 'gitlab_token';
const gitlabUrl = 'https://othertesturl.com:9090';
const gitlab = authenticate({gitlabUrl})
.get(`/projects/${owner}%2F${repo}`)
.reply(200, {permissions: {project_access: {access_level: 40}}});

await t.notThrows(
verify({gitlabUrl}, {repositoryUrl: `[email protected]:${owner}/${repo}.git`}, t.context.logger)
);

t.true(gitlab.isDone());
t.deepEqual(t.context.log.args[0], ['Verify GitLab authentication (%s)', 'https://othertesturl.com:9090/api/v4']);
});

test.serial('Verify token and repository access with subgroup git URL', async t => {
const repoUri = 'orga/subgroup/test_user/test_repo';
process.env.GL_TOKEN = 'gitlab_token';
Expand Down Expand Up @@ -160,7 +177,7 @@ test.serial('Verify token and repository access with empty gitlabApiPathPrefix',
);

t.true(gitlab.isDone());
t.deepEqual(t.context.log.args[0], ['Verify GitLab authentication (%s)', 'https://othertesturl.com:9090/']);
t.deepEqual(t.context.log.args[0], ['Verify GitLab authentication (%s)', 'https://othertesturl.com:9090']);
});

test.serial('Verify token and repository with environment variables', async t => {
Expand Down

0 comments on commit 9cf0a55

Please sign in to comment.