Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Aug 28, 2019
1 parent 4d276e2 commit e9fd192
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 49 deletions.
3 changes: 0 additions & 3 deletions test/tap/bearer-token-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ var writeFileSync = require('graceful-fs').writeFileSync
var fs = require('fs')
var mkdirp = require('mkdirp')
var http = require('http')
var osenv = require('osenv')
var rimraf = require('rimraf')
const t = require('tap')

var common = require('../common-tap.js')
Expand Down Expand Up @@ -38,7 +36,6 @@ server.on('request', (req, res) => {
}
})


var contents = '@scoped:registry=' + common.registry + '\n' +
toNerfDart(common.registry) + ':_authToken=0xabad1dea\n'

Expand Down
16 changes: 3 additions & 13 deletions test/tap/version-commit-hooks.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
var fs = require('graceful-fs')
var path = require('path')
var osenv = require('osenv')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
const fs = require('graceful-fs')
const path = require('path')
const common = require('../common-tap.js')
var pkg = common.pkg
const pkg = common.pkg

var test = require('tap').test
var npm = require('../../')

delete process.env['npm_config_commit_hooks']

test('npm version <semver> with commit-hooks disabled in .npmrc', function (t) {
mkdirp.sync(pkg)
var npmrc = path.resolve(pkg, '.npmrc')
fs.writeFileSync(npmrc, 'commit-hooks=false\n', 'ascii')
process.chdir(pkg)
Expand Down Expand Up @@ -57,9 +53,3 @@ test('npm version <semver> with commit-hooks enabled (default)', function (t) {
t.end()
})
})

test('cleanup', function (t) {
process.chdir(osenv.tmpdir())
rimraf.sync(pkg)
t.end()
})
11 changes: 0 additions & 11 deletions test/tap/version-consistent-newlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
const common = require('../common-tap.js')
const test = require('tap').test
const npm = require('../../')
const osenv = require('osenv')
const path = require('path')
const fs = require('fs')
const mkdirp = require('mkdirp')
const rimraf = require('rimraf')
const requireInject = require('require-inject')

const pkg = common.pkg
Expand Down Expand Up @@ -66,16 +64,7 @@ test('npm version does not alter the line endings in package.json (CRLF)', funct
})
})

test('cleanup', function (t) {
process.chdir(osenv.tmpdir())

rimraf.sync(pkg)
t.end()
})

function setup (lineEnding) {
mkdirp.sync(pkg)
mkdirp.sync(cache)
mkdirp.sync(gitDir)
fs.writeFileSync(
path.resolve(pkg, 'package.json'),
Expand Down
25 changes: 3 additions & 22 deletions test/tap/version-sub-directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ var fs = require('fs')
var path = require('path')

var mkdirp = require('mkdirp')
var osenv = require('osenv')
var rimraf = require('rimraf')
var test = require('tap').test

var npm = require('../../lib/npm.js')
Expand All @@ -17,7 +15,9 @@ var cache = common.cache
var json = { name: 'cat', version: '0.1.2' }

test('npm version <semver> from a subdirectory', function (t) {
setup()
mkdirp.sync(subDirectory)
process.chdir(subDirectory)
fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8')
npmLoad()

function npmLoad () {
Expand Down Expand Up @@ -54,22 +54,3 @@ test('npm version <semver> from a subdirectory', function (t) {
t.end()
}
})

test('cleanup', function (t) {
cleanup()
t.end()
})

function cleanup () {
// windows fix for locked files
process.chdir(osenv.tmpdir())
rimraf.sync(pkg)
}

function setup () {
cleanup()
mkdirp.sync(cache)
mkdirp.sync(subDirectory)
process.chdir(subDirectory)
fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8')
}

0 comments on commit e9fd192

Please sign in to comment.