Skip to content

Commit 9cf0a55

Browse files
greenkeeper[bot]pvdlg
authored andcommitted
fix(package): update url-join to version 4.0.0
1 parent 111e894 commit 9cf0a55

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"escape-string-regexp": "^1.0.5",
2222
"got": "^8.0.1",
2323
"parse-path": "^3.0.2",
24-
"url-join": "^3.0.0"
24+
"url-join": "^4.0.0"
2525
},
2626
"devDependencies": {
2727
"ava": "^0.25.0",

test/verify.test.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ test.serial('Verify token and repository access (group_access 40)', async t => {
7979
t.true(gitlab.isDone());
8080
});
8181

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

104+
test.serial('Verify token and repository access and custom URL without prefix', async t => {
105+
const owner = 'test_user';
106+
const repo = 'test_repo';
107+
process.env.GL_TOKEN = 'gitlab_token';
108+
const gitlabUrl = 'https://othertesturl.com:9090';
109+
const gitlab = authenticate({gitlabUrl})
110+
.get(`/projects/${owner}%2F${repo}`)
111+
.reply(200, {permissions: {project_access: {access_level: 40}}});
112+
113+
await t.notThrows(
114+
verify({gitlabUrl}, {repositoryUrl: `[email protected]:${owner}/${repo}.git`}, t.context.logger)
115+
);
116+
117+
t.true(gitlab.isDone());
118+
t.deepEqual(t.context.log.args[0], ['Verify GitLab authentication (%s)', 'https://othertesturl.com:9090/api/v4']);
119+
});
120+
104121
test.serial('Verify token and repository access with subgroup git URL', async t => {
105122
const repoUri = 'orga/subgroup/test_user/test_repo';
106123
process.env.GL_TOKEN = 'gitlab_token';
@@ -160,7 +177,7 @@ test.serial('Verify token and repository access with empty gitlabApiPathPrefix',
160177
);
161178

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

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

0 commit comments

Comments
 (0)