Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/normalize-git-url/test/basic.js~')
-rw-r--r--deps/npm/node_modules/normalize-git-url/test/basic.js~56
1 files changed, 56 insertions, 0 deletions
diff --git a/deps/npm/node_modules/normalize-git-url/test/basic.js~ b/deps/npm/node_modules/normalize-git-url/test/basic.js~
new file mode 100644
index 00000000000..00ac6d3131b
--- /dev/null
+++ b/deps/npm/node_modules/normalize-git-url/test/basic.js~
@@ -0,0 +1,56 @@
+var test = require('tap').test
+
+var normalize = require('../normalize-git-url.js')
+
+test('basic normalization tests', function (t) {
+ t.same(
+ normalize('git+ssh://user@hostname:project.git#commit-ish'),
+ { url: 'user@hostname:project.git', branch: 'commit-ish' }
+ )
+ t.same(
+ normalize('git+http://user@hostname/project/blah.git#commit-ish'),
+ { url: 'http://user@hostname/project/blah.git', branch: 'commit-ish' }
+ )
+ t.same(
+ normalize('git+https://user@hostname/project/blah.git#commit-ish'),
+ { url: 'https://user@hostname/project/blah.git', branch: 'commit-ish' }
+ )
+ t.same(
+ normalize('git+ssh://git@github.com:npm/npm.git#v1.0.27'),
+ { url: 'git@github.com:npm/npm.git', branch: 'v1.0.27' }
+ )
+ t.same(
+ normalize('git+ssh://git@github.com:org/repo#dev'),
+ { url: 'git@github.com:org/repo', branch: 'dev' }
+ )
+ t.same(
+ normalize('git+ssh://git@github.com/org/repo#dev'),
+ { url: 'ssh://git@github.com/org/repo', branch: 'dev' }
+ )
+ t.same(
+ normalize('git+ssh://foo:22/some/path'),
+ { url: 'ssh://foo:22/some/path', branch: 'master' }
+ )
+ t.same(
+ normalize('git@github.com:org/repo#dev'),
+ { url: 'git@github.com:org/repo', branch: 'dev' }
+ )
+ t.same(
+ normalize('git+https://github.com/KenanY/node-uuid'),
+ { url: 'https://github.com/KenanY/node-uuid', branch: 'master' }
+ )
+ t.same(
+ normalize('git+https://github.com/KenanY/node-uuid#7a018f2d075b03a73409e8356f9b29c9ad4ea2c5'),
+ { url: 'https://github.com/KenanY/node-uuid', branch: '7a018f2d075b03a73409e8356f9b29c9ad4ea2c5' }
+ )
+ t.same(
+ normalize('git+ssh://git@git.example.com:b/b.git#v1.0.0'),
+ { url: 'git@git.example.com:b/b.git', branch: 'v1.0.0' }
+ )
+ t.same(
+ normalize('git+ssh://git@github.com:npm/npm-proto.git#othiym23/organized'),
+ { url: 'git@github.com:npm/npm-proto.git', branch: 'othiym23/organized' }
+ )
+
+ t.end()
+})