@@ -31,7 +31,8 @@ test.afterEach.always(() => {
31
31
} ) ;
32
32
33
33
test . serial ( 'Default values, reading repositoryUrl from package.json' , async t => {
34
- const pkg = { repository :
'[email protected] :owner/module.git' } ;
34
+ process . env . GIT_CREDENTIALS = 'user:pass' ;
35
+ const pkg = { repository : 'https://package.com/owner/module.git' } ;
35
36
// Create a git repository, set the current working directory at the root of the repo
36
37
await gitRepo ( ) ;
37
38
await gitCommits ( [ 'First' ] ) ;
@@ -44,25 +45,27 @@ test.serial('Default values, reading repositoryUrl from package.json', async t =
44
45
45
46
// Verify the default options are set
46
47
t . is ( options . branch , 'master' ) ;
47
- t . is ( options . repositoryUrl , 'git @package.com: owner/module.git' ) ;
48
+ t . is ( options . repositoryUrl , 'https://user:pass @package.com/ owner/module.git' ) ;
48
49
t . is ( options . tagFormat , `v\${version}` ) ;
49
50
} ) ;
50
51
51
52
test . serial ( 'Default values, reading repositoryUrl from repo if not set in package.json' , async t => {
53
+ process . env . GIT_CREDENTIALS = 'user:pass' ;
52
54
// Create a git repository, set the current working directory at the root of the repo
53
55
await gitRepo ( ) ;
54
56
// Add remote.origin.url config
55
- await gitAddConfig ( 'remote.origin.url' , 'git@repo .com: owner/module.git' ) ;
57
+ await gitAddConfig ( 'remote.origin.url' , 'https://hostname .com/ owner/module.git' ) ;
56
58
57
59
const { options} = await t . context . getConfig ( ) ;
58
60
59
61
// Verify the default options are set
60
62
t . is ( options . branch , 'master' ) ;
61
- t . is ( options . repositoryUrl , 'git@repo .com: owner/module.git' ) ;
63
+ t . is ( options . repositoryUrl , 'https://user:pass@hostname .com/ owner/module.git' ) ;
62
64
t . is ( options . tagFormat , `v\${version}` ) ;
63
65
} ) ;
64
66
65
67
test . serial ( 'Default values, reading repositoryUrl (http url) from package.json if not set in repo' , async t => {
68
+ process . env . GIT_CREDENTIALS = 'user:pass' ;
66
69
const pkg = { repository : 'https://hostname.com/owner/module.git' } ;
67
70
// Create a git repository, set the current working directory at the root of the repo
68
71
await gitRepo ( ) ;
@@ -73,7 +76,7 @@ test.serial('Default values, reading repositoryUrl (http url) from package.json
73
76
74
77
// Verify the default options are set
75
78
t . is ( options . branch , 'master' ) ;
76
- t . is ( options . repositoryUrl , pkg . repository ) ;
79
+ t . is ( options . repositoryUrl , 'https://user:[email protected] /owner/module.git' ) ;
77
80
t . is ( options . tagFormat , `v\${version}` ) ;
78
81
} ) ;
79
82
0 commit comments