Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Convert shrinkwrap test script from bash to Node.
Browse files Browse the repository at this point in the history
Works better on Windows.
  • Loading branch information
domenic committed Nov 6, 2012
1 parent ad0f64d commit bbb5741
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
2 changes: 1 addition & 1 deletion test/packages/npm-test-shrinkwrap/package.json
Expand Up @@ -8,6 +8,6 @@
"minimatch": "~0.1.0"
},
"scripts": {
"test": "bash test.sh"
"test": "node test.js"
}
}
19 changes: 19 additions & 0 deletions test/packages/npm-test-shrinkwrap/test.js
@@ -0,0 +1,19 @@
var path = require("path")
var assert = require("assert")

process.env.npm_config_prefix = process.cwd()
delete process.env.npm_config_global
delete process.env.npm_config_depth

var npm = path.resolve(process.env.npm_config_prefix, "../../npm")

require("child_process").exec(npm + " ls --json", {
stdio: "pipe", env: process.env, cwd: process.cwd() },
function (err, stdout, stderr) {
if (err) throw err

var actual = JSON.parse(stdout).dependencies
var expected = require("./npm-shrinkwrap.json").dependencies

assert.deepEqual(actual, expected)
})
20 changes: 0 additions & 20 deletions test/packages/npm-test-shrinkwrap/test.sh

This file was deleted.

0 comments on commit bbb5741

Please sign in to comment.