Merge pull request #210 from anatoliychakkaev/master
Amends for list and version exposing
This commit is contained in:
commit
ee6bc85e75
2
index.js
2
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) {}
|
||||
|
||||
|
|
|
@ -174,7 +174,11 @@ List.prototype.map = function(cb) {
|
|||
};
|
||||
|
||||
function ListItem(data, parent) {
|
||||
for (var i in data) this[i] = data[i];
|
||||
if (typeof data === 'object') {
|
||||
for (var i in data) this[i] = data[i];
|
||||
} else {
|
||||
this.id = data;
|
||||
}
|
||||
Object.defineProperty(this, 'parent', {
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
|
|
|
@ -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();
|
||||
});
|
|
@ -11,7 +11,7 @@ try {
|
|||
}
|
||||
|
||||
var group_name = false, EXT_EXP;
|
||||
function it (should, test_case) {
|
||||
function it(should, test_case) {
|
||||
check_external_exports();
|
||||
if (group_name) {
|
||||
EXT_EXP[group_name][should] = test_case;
|
||||
|
@ -39,7 +39,7 @@ function context(name, tests) {
|
|||
|
||||
global.context = context;
|
||||
|
||||
exports.init = function (external_exports) {
|
||||
exports.init = function init(external_exports) {
|
||||
EXT_EXP = external_exports;
|
||||
if (external_exports.done) {
|
||||
external_exports.done();
|
||||
|
|
Loading…
Reference in New Issue