summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/hosted-git-info/test/bitbucket-https-with-embedded-auth.js
blob: a2feb2f0e18acb2b1c8376025b6f5b8aafd816f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict'
var HostedGit = require('../index')
var test = require('tap').test

test('Bitbucket HTTPS URLs with embedded auth', function (t) {
  t.is(
    HostedGit.fromUrl('https://user:pass@bitbucket.org/user/repo.git').toString(),
    'git+https://user:pass@bitbucket.org/user/repo.git',
    'credentials were included in URL'
  )
  t.is(
    HostedGit.fromUrl('https://user:pass@bitbucket.org/user/repo').toString(),
    'git+https://user:pass@bitbucket.org/user/repo.git',
    'credentials were included in URL'
  )
  t.is(
    HostedGit.fromUrl('git+https://user:pass@bitbucket.org/user/repo.git').toString(),
    'git+https://user:pass@bitbucket.org/user/repo.git',
    'credentials were included in URL'
  )
  t.is(
    HostedGit.fromUrl('git+https://user:pass@bitbucket.org/user/repo').toString(),
    'git+https://user:pass@bitbucket.org/user/repo.git',
    'credentials were included in URL'
  )
  t.end()
})