diff options
author | Rebecca Turner <me@re-becca.org> | 2015-08-21 14:33:21 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-08-27 02:51:13 +0300 |
commit | f4a578424b1f9d12f58210c229e7af633d952587 (patch) | |
tree | a22707d4392fb74e6f1ab08f0354a113e7f45ba6 /test | |
parent | 4468c92eccd0814b567606897e0792e49640e056 (diff) |
fetch-package-metadata: Add direct support for local modules
PR-URL: https://github.com/npm/npm/pull/9369
Fixes: #9308
Diffstat (limited to 'test')
-rw-r--r-- | test/tap/verify-no-lifecycle-on-repo.js | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/tap/verify-no-lifecycle-on-repo.js b/test/tap/verify-no-lifecycle-on-repo.js new file mode 100644 index 000000000..29f79e298 --- /dev/null +++ b/test/tap/verify-no-lifecycle-on-repo.js @@ -0,0 +1,54 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var common = require('../common-tap.js') + +var base = path.join(__dirname, path.basename(__filename, '.js')) + +var baseJSON = { + name: 'base', + version: '1.0.0', + repository: { + type: 'git', + url: 'http://example.com' + }, + scripts: { + prepublish: 'false' + } +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +test('repo', function (t) { + common.npm(['repo', '--browser=echo'], {cwd: base}, function (er, code, stdout, stderr) { + t.ifError(er, 'npm config ran without issue') + t.is(code, 0, 'exited with a non-error code') + t.is(stderr, '', 'Ran without errors') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function saveJson (pkgPath, json) { + mkdirp.sync(pkgPath) + fs.writeFileSync(path.join(pkgPath, 'package.json'), JSON.stringify(json, null, 2)) +} + +function setup () { + saveJson(base, baseJSON) +} + +function cleanup () { + rimraf.sync(base) +} |