Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-02-29 06:16:58 +0400
committerisaacs <i@izs.me>2012-02-29 06:38:41 +0400
commit0c581e4a3e2d2d1fb4ffcdb64e21bd627d7849d1 (patch)
tree29ba14f8193a809c1b45296f2646ab98bd125648 /test
parent80acc0e376322f051cde439e5cc932138911931b (diff)
shrinkwrap test
Diffstat (limited to 'test')
-rw-r--r--test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json43
-rw-r--r--test/packages/npm-test-shrinkwrap/package.json13
-rw-r--r--test/packages/npm-test-shrinkwrap/test.sh20
3 files changed, 76 insertions, 0 deletions
diff --git a/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json b/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json
new file mode 100644
index 000000000..c4f7fbf81
--- /dev/null
+++ b/test/packages/npm-test-shrinkwrap/npm-shrinkwrap.json
@@ -0,0 +1,43 @@
+{
+ "name": "npm-test-shrinkwrap",
+ "version": "0.0.0",
+ "dependencies": {
+ "npm-test-single-file": {
+ "version": "1.2.3",
+ "from": "https://raw.github.com/gist/1837112/index.js"
+ },
+ "glob": {
+ "version": "3.1.4",
+ "from": "git://github.com/isaacs/node-glob.git",
+ "dependencies": {
+ "minimatch": {
+ "version": "0.2.0",
+ "dependencies": {
+ "lru-cache": {
+ "version": "1.0.5"
+ }
+ }
+ },
+ "graceful-fs": {
+ "version": "1.1.5",
+ "dependencies": {
+ "fast-list": {
+ "version": "1.0.2"
+ }
+ }
+ },
+ "inherits": {
+ "version": "1.0.0"
+ }
+ }
+ },
+ "minimatch": {
+ "version": "0.1.5",
+ "dependencies": {
+ "lru-cache": {
+ "version": "1.0.5"
+ }
+ }
+ }
+ }
+}
diff --git a/test/packages/npm-test-shrinkwrap/package.json b/test/packages/npm-test-shrinkwrap/package.json
new file mode 100644
index 000000000..34a8abc21
--- /dev/null
+++ b/test/packages/npm-test-shrinkwrap/package.json
@@ -0,0 +1,13 @@
+{
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "name": "npm-test-shrinkwrap",
+ "version": "0.0.0",
+ "dependencies": {
+ "npm-test-single-file": "https://raw.github.com/gist/1837112/index.js",
+ "glob": "git://github.com/isaacs/node-glob.git",
+ "minimatch": "~0.1.0"
+ },
+ "scripts": {
+ "test": "bash test.sh"
+ }
+}
diff --git a/test/packages/npm-test-shrinkwrap/test.sh b/test/packages/npm-test-shrinkwrap/test.sh
new file mode 100644
index 000000000..f756f5b42
--- /dev/null
+++ b/test/packages/npm-test-shrinkwrap/test.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# ensure that we get the npm being tested, not some global thing.
+npmbin=$npm_config_prefix/bin/npm
+npm () {
+ node $npmbin "$@"
+}
+
+# work around the weird env we're in, as part of npm's test
+export npm_config_prefix=$PWD
+unset npm_config_global
+unset npm_config_depth
+
+out=$(diff <(npm ls --json) npm-shrinkwrap.json)
+if [ "$out" != "" ]; then
+ echo "Didn't get expected packages" >&2
+ echo "$out" >&2
+ exit 1
+fi
+echo "ok"