[Pkg-javascript-commits] [node-bluebird] 03/03: Add a manual test procedure

Ross Gammon ross-guest at moszumanska.debian.org
Mon Mar 9 20:01:22 UTC 2015


This is an automated email from the git hooks/post-receive script.

ross-guest pushed a commit to branch master
in repository node-bluebird.

commit 0e62a22792fc9879f37fb46592293e770d528d7c
Author: Ross Gammon <rossgammon at mail.dk>
Date:   Mon Mar 9 21:00:45 2015 +0100

    Add a manual test procedure
---
 debian/README.test | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/debian/README.test b/debian/README.test
new file mode 100644
index 0000000..08004d3
--- /dev/null
+++ b/debian/README.test
@@ -0,0 +1,42 @@
+A small test of bluebird is to use a slightly modified version of the
+example snippets.js file found on the upstream wiki:
+https://github.com/petkaantonov/bluebird/wiki/Snippets#reading-directory-and-sub-directory-contents-recursively
+
+Create a file called snippets.js with the following code in it:
+var Promise = require("bluebird");
+var fs = Promise.promisifyAll(require("fs"));
+var Path = require("path");
+
+function readDir(dirName) {
+    return fs.readdirAsync(dirName).map(function (fileName) {
+        var path = Path.join(dirName, fileName);
+        return fs.statAsync(path).then(function(stat) {
+            return stat.isDirectory() ? readDir(path) : path;
+        });
+    }).reduce(function (a, b) {
+        return a.concat(b);
+    }, []);
+}
+
+readDir(".").then(function(v){
+    console.log(v.join("\n"));
+});
+
+Then from the source tree run: $ nodejs snippets.js
+You should see a recursive file listing of your current directory
+
+Note: At the moment this doesn't work, because we need to install the
+bluebird.js created by the upstream build.js --main option.
+To observe this problem, run the following in the source tree:
+	$ NODE_PATH=src nodejs tools/build.js --no-debug --main
+	$ NODE_PATH=js/main nodejs snippets.js
+works. Note that you have to have all the dev dependencies installed before
+running the build command (using "npm install" in the root source directory
+until we have them packaged).
+
+Running:
+	$ NODE_PATH=src nodejs snippets.js
+fails.
+
+To do:
+Add a test for the browser (libjs) version of bluebird.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-bluebird.git



More information about the Pkg-javascript-commits mailing list