mirror of
https://github.com/nodejs/node.git
synced 2025-05-15 22:04:26 +00:00

* Check SHA before using files from cache * adduser: allow change of the saved password * Make `npm install` respect `config.unicode` * Fix lifecycle to pass `Infinity` for config env value * Don't return 0 exit code on invalid command * cache: Handle 404s and other HTTP errors as errors * bump tap dep, make tests stderr a bit quieter * Resolve ~ in path configs to env.HOME * Include npm version in default user-agent conf * npm init: Use ISC as default license, use save-prefix for deps * Many test and doc fixes
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
JavaScript
var assert = require("assert")
|
|
var getUrl = require("../")
|
|
|
|
describe("github url from username/repo", function () {
|
|
it("returns a github url for the username/repo", function () {
|
|
var url = getUrl("visionmedia/express")
|
|
assert.equal("git://github.com/visionmedia/express", url)
|
|
})
|
|
|
|
it("returns null if it does not match", function () {
|
|
var url = getUrl("package")
|
|
assert.deepEqual(null, url)
|
|
})
|
|
|
|
it("returns null if no repo/user was given", function () {
|
|
var url = getUrl()
|
|
assert.deepEqual(null, url)
|
|
})
|
|
|
|
it("works with .", function () {
|
|
var url = getUrl("component/downloader.js")
|
|
assert.equal("git://github.com/component/downloader.js", url)
|
|
})
|
|
|
|
it("works with . in the beginning", function () {
|
|
var url = getUrl("component/.downloader.js")
|
|
assert.equal("git://github.com/component/.downloader.js", url)
|
|
})
|
|
|
|
it("works with -", function () {
|
|
var url = getUrl("component/-dow-nloader.j-s")
|
|
assert.equal("git://github.com/component/-dow-nloader.j-s", url)
|
|
})
|
|
})
|