From 7bb233e269a3c711dc6119a186b46078680b9586 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Tue, 19 Feb 2013 16:32:21 +0800 Subject: [PATCH] Fix package version exposing --- index.js | 2 +- test/jugglingdb_test.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/jugglingdb_test.js diff --git a/index.js b/index.js index d981af93..cdc8cbf8 100644 --- a/index.js +++ b/index.js @@ -25,7 +25,7 @@ try { if (process.versions.node < '0.6') { exports.version = JSON.parse(fs.readFileSync(__dirname + '/package.json')).version; } else { - exports.version = require('../package').version; + exports.version = require('./package').version; } } catch (e) {} diff --git a/test/jugglingdb_test.js b/test/jugglingdb_test.js new file mode 100644 index 00000000..2ec306f4 --- /dev/null +++ b/test/jugglingdb_test.js @@ -0,0 +1,8 @@ +var juggling = require('../index'); +require('./spec_helper').init(module.exports); + +it('should expose version', function (test) { + console.log('version:', juggling.version); + test.ok(juggling.version); + test.done(); +});