aboutsummaryrefslogtreecommitdiff
path: root/test/fixtures/test-module-loading-globalpaths
diff options
context:
space:
mode:
authorRichard Lau <riclau@uk.ibm.com>2016-10-20 15:38:54 -0400
committerGibson Fahnestock <gibfahn@gmail.com>2017-03-11 22:08:18 +0000
commit92e7c93fce831650a0aea554074b0d0a8eb97f1c (patch)
treeb88150a52f294db678e853a54dfbb40f3272a167 /test/fixtures/test-module-loading-globalpaths
parent443691a5aef8a908bc4c6f63b1710eb988235674 (diff)
downloadandroid-node-v8-92e7c93fce831650a0aea554074b0d0a8eb97f1c.tar.gz
android-node-v8-92e7c93fce831650a0aea554074b0d0a8eb97f1c.tar.bz2
android-node-v8-92e7c93fce831650a0aea554074b0d0a8eb97f1c.zip
test: add test for loading from global folders
Test executes with a copy of the node executable since $PREFIX/lib/node is relative to the executable location. PR-URL: https://github.com/nodejs/node/pull/9283 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: João Reis <reis@janeasystems.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'test/fixtures/test-module-loading-globalpaths')
-rw-r--r--test/fixtures/test-module-loading-globalpaths/home-pkg-in-both/.node_libraries/foo.js1
-rw-r--r--test/fixtures/test-module-loading-globalpaths/home-pkg-in-both/.node_modules/foo.js1
-rw-r--r--test/fixtures/test-module-loading-globalpaths/home-pkg-in-node_libraries/.node_libraries/foo.js1
-rw-r--r--test/fixtures/test-module-loading-globalpaths/home-pkg-in-node_modules/.node_modules/foo.js1
-rw-r--r--test/fixtures/test-module-loading-globalpaths/local-pkg/node_modules/foo.js1
-rw-r--r--test/fixtures/test-module-loading-globalpaths/local-pkg/test.js2
-rw-r--r--test/fixtures/test-module-loading-globalpaths/node_path/foo.js1
7 files changed, 8 insertions, 0 deletions
diff --git a/test/fixtures/test-module-loading-globalpaths/home-pkg-in-both/.node_libraries/foo.js b/test/fixtures/test-module-loading-globalpaths/home-pkg-in-both/.node_libraries/foo.js
new file mode 100644
index 0000000000..eb278f9576
--- /dev/null
+++ b/test/fixtures/test-module-loading-globalpaths/home-pkg-in-both/.node_libraries/foo.js
@@ -0,0 +1 @@
+exports.string = '$HOME/.node_libraries';
diff --git a/test/fixtures/test-module-loading-globalpaths/home-pkg-in-both/.node_modules/foo.js b/test/fixtures/test-module-loading-globalpaths/home-pkg-in-both/.node_modules/foo.js
new file mode 100644
index 0000000000..8a665b3e98
--- /dev/null
+++ b/test/fixtures/test-module-loading-globalpaths/home-pkg-in-both/.node_modules/foo.js
@@ -0,0 +1 @@
+exports.string = '$HOME/.node_modules';
diff --git a/test/fixtures/test-module-loading-globalpaths/home-pkg-in-node_libraries/.node_libraries/foo.js b/test/fixtures/test-module-loading-globalpaths/home-pkg-in-node_libraries/.node_libraries/foo.js
new file mode 100644
index 0000000000..eb278f9576
--- /dev/null
+++ b/test/fixtures/test-module-loading-globalpaths/home-pkg-in-node_libraries/.node_libraries/foo.js
@@ -0,0 +1 @@
+exports.string = '$HOME/.node_libraries';
diff --git a/test/fixtures/test-module-loading-globalpaths/home-pkg-in-node_modules/.node_modules/foo.js b/test/fixtures/test-module-loading-globalpaths/home-pkg-in-node_modules/.node_modules/foo.js
new file mode 100644
index 0000000000..8a665b3e98
--- /dev/null
+++ b/test/fixtures/test-module-loading-globalpaths/home-pkg-in-node_modules/.node_modules/foo.js
@@ -0,0 +1 @@
+exports.string = '$HOME/.node_modules';
diff --git a/test/fixtures/test-module-loading-globalpaths/local-pkg/node_modules/foo.js b/test/fixtures/test-module-loading-globalpaths/local-pkg/node_modules/foo.js
new file mode 100644
index 0000000000..63e844e4d4
--- /dev/null
+++ b/test/fixtures/test-module-loading-globalpaths/local-pkg/node_modules/foo.js
@@ -0,0 +1 @@
+exports.string = 'local';
diff --git a/test/fixtures/test-module-loading-globalpaths/local-pkg/test.js b/test/fixtures/test-module-loading-globalpaths/local-pkg/test.js
new file mode 100644
index 0000000000..8054983e99
--- /dev/null
+++ b/test/fixtures/test-module-loading-globalpaths/local-pkg/test.js
@@ -0,0 +1,2 @@
+'use strict';
+console.log(require('foo').string);
diff --git a/test/fixtures/test-module-loading-globalpaths/node_path/foo.js b/test/fixtures/test-module-loading-globalpaths/node_path/foo.js
new file mode 100644
index 0000000000..3ce43c4920
--- /dev/null
+++ b/test/fixtures/test-module-loading-globalpaths/node_path/foo.js
@@ -0,0 +1 @@
+exports.string = '$NODE_PATH';