summaryrefslogtreecommitdiff
path: root/deps/npm/test/tap/version-update-shrinkwrap.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/test/tap/version-update-shrinkwrap.js')
-rw-r--r--deps/npm/test/tap/version-update-shrinkwrap.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/deps/npm/test/tap/version-update-shrinkwrap.js b/deps/npm/test/tap/version-update-shrinkwrap.js
index c51ab2cb0d..d9f54d6872 100644
--- a/deps/npm/test/tap/version-update-shrinkwrap.js
+++ b/deps/npm/test/tap/version-update-shrinkwrap.js
@@ -110,15 +110,12 @@ test('npm version <semver> updates shrinkwrap and updates git', function (t) {
})
test('cleanup', function (t) {
- // windows fix for locked files
- process.chdir(osenv.tmpdir())
-
- rimraf.sync(pkg)
+ cleanup()
t.end()
})
function setup () {
- rimraf.sync(pkg)
+ cleanup()
mkdirp.sync(pkg)
mkdirp.sync(cache)
var contents = {
@@ -132,3 +129,10 @@ function setup () {
fs.writeFileSync(path.resolve(pkg, 'npm-shrinkwrap.json'), JSON.stringify(contents), 'utf8')
process.chdir(pkg)
}
+
+function cleanup () {
+ // windows fix for locked files
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(cache)
+ rimraf.sync(pkg)
+}