Comparing version 0.5.4 to 0.5.5
{ | ||
"name": "lazy-ass", | ||
"main": "index.js", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"homepage": "https://github.com/bahmutov/lazy-ass", | ||
@@ -17,3 +17,2 @@ "license": "MIT", | ||
], | ||
"author": "Gleb Bahmutov <gleb.bahmutov@gmail.com>", | ||
"keywords": [ | ||
@@ -27,3 +26,7 @@ "lazy", | ||
"browser" | ||
] | ||
], | ||
"authors": [ | ||
"Gleb Bahmutov <gleb.bahmutov@gmail.com>" | ||
], | ||
"description": "Lazy assertions without performance penalty" | ||
} |
@@ -38,3 +38,8 @@ (function initLazyAss() { | ||
} catch (err) { | ||
argString = '[cannot stringify arg ' + k + ']'; | ||
argString = '[cannot stringify arg ' + k + ', it has type ' + typeof arg; | ||
if (typeof arg === 'object') { | ||
argString += ' with keys ' + Object.keys(arg).join(', ') + ']'; | ||
} else { | ||
argString += ']'; | ||
} | ||
} | ||
@@ -41,0 +46,0 @@ return total + argString; |
{ | ||
"name": "lazy-ass", | ||
"description": "Lazy assertions without performance penalty", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"author": "Gleb Bahmutov <gleb.bahmutov@gmail.com>", | ||
@@ -12,30 +12,30 @@ "bugs": { | ||
"devDependencies": { | ||
"bad-line": "0.0.2", | ||
"bad-line": "0.1.1", | ||
"coveralls": "2.11.2", | ||
"cute-stack": "1.0.2", | ||
"cute-stack": "1.3.1", | ||
"expect.js": "0.3.1", | ||
"grunt": "0.4.5", | ||
"grunt-banner": "0.2.3", | ||
"grunt-banner": "0.3.1", | ||
"grunt-clean-console": "0.1.1", | ||
"grunt-contrib-concat": "0.5.0", | ||
"grunt-contrib-copy": "0.7.0", | ||
"grunt-contrib-jshint": "0.10.0", | ||
"grunt-contrib-uglify": "0.7.0", | ||
"grunt-contrib-concat": "0.5.1", | ||
"grunt-contrib-copy": "0.8.0", | ||
"grunt-contrib-jshint": "0.11.2", | ||
"grunt-contrib-uglify": "0.9.1", | ||
"grunt-contrib-watch": "0.6.1", | ||
"grunt-deps-ok": "0.5.2", | ||
"grunt-deps-ok": "0.7.1", | ||
"grunt-gh-pages": "0.10.0", | ||
"grunt-karma": "0.9.0", | ||
"grunt-mocha-test": "0.11.0", | ||
"grunt-karma": "0.10.1", | ||
"grunt-mocha-test": "0.12.7", | ||
"grunt-nice-package": "0.9.2", | ||
"grunt-npm2bower-sync": "0.4.0", | ||
"jshint-stylish": "0.4.0", | ||
"karma": "0.12.28", | ||
"karma-chrome-launcher": "0.1.7", | ||
"karma-coverage": "0.2.7", | ||
"grunt-npm2bower-sync": "0.8.1", | ||
"jshint-stylish": "1.0.2", | ||
"karma": "0.12.32", | ||
"karma-chrome-launcher": "0.1.8", | ||
"karma-coverage": "0.3.1", | ||
"karma-mocha": "0.1.10", | ||
"karma-phantomjs-launcher": "0.1.4", | ||
"matchdep": "0.3.0", | ||
"mocha": "1.21.5", | ||
"pre-git": "0.1.1", | ||
"time-grunt": "0.4.0" | ||
"mocha": "2.2.4", | ||
"pre-git": "0.2.1", | ||
"time-grunt": "1.1.1" | ||
}, | ||
@@ -42,0 +42,0 @@ "engines": { |
@@ -193,3 +193,40 @@ /* global lazyAss, la */ | ||
}); | ||
describe('gives context to non-serializable objects', function () { | ||
it('prints keys in non-serializable objects', function () { | ||
var foo = { | ||
bar: 'bar' | ||
}; | ||
foo.foo = foo; | ||
expect(function () { | ||
lazyAss(false, foo); | ||
}).to.throwException(function (err) { | ||
expect(err.message).to.contain('type object'); | ||
expect(err.message).to.contain('foo'); | ||
expect(err.message).to.contain('bar'); | ||
}); | ||
}); | ||
it('handles several objects', function () { | ||
var foo = { | ||
bar: 'bar' | ||
}; | ||
foo.foo = foo; | ||
var bar = { | ||
foo: foo | ||
}; | ||
expect(function () { | ||
lazyAss(false, foo, bar); | ||
}).to.throwException(function (err) { | ||
expect(err.message).to.contain('arg 0'); | ||
expect(err.message).to.contain('arg 1'); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}(this)); |
Sorry, the diff of this file is not supported yet
28191
509