forked from tj/node-github-url-from-git
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
40 lines (32 loc) · 1.29 KB
/
test.js
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
28
29
30
31
32
33
34
35
36
37
38
39
40
var parse = require('./');
var assert = require('better-assert');
describe('parse(url)', function(){
it('should support git://*', function(){
var url = 'git://github.com/jamesor/mongoose-versioner';
parse(url).should.equal('https://github.com/jamesor/mongoose-versioner');
})
it('should support git://*.git', function(){
var url = 'git://github.com/treygriffith/cellar.git';
parse(url).should.equal('https://github.com/treygriffith/cellar');
})
it('should support https://*', function(){
var url = 'https://github.com/Empeeric/i18n-node';
parse(url).should.equal('https://github.com/Empeeric/i18n-node');
})
it('should support https://*.git', function(){
var url = 'https://[email protected]/banchee/tranquil.git';
parse(url).should.equal('https://github.com/banchee/tranquil');
})
it('should return undefined on failure', function(){
var url = 'git://github.com/justgord/.git';
assert(null == parse(url));
})
it('should parse git@gist urls', function() {
var url = '[email protected]:3135914.git';
parse(url).should.equal('https://gist.github.com/3135914')
})
it('should parse https://gist urls', function() {
var url = 'https://gist.github.com/3135914.git';
parse(url).should.equal('https://gist.github.com/3135914')
})
})