Skip to content

Commit

Permalink
failing test for type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jul 1, 2014
1 parent 50fcd29 commit 385b615
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/err.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var inspect = require('../');
var test = require('tape');

test('type error', function (t) {
t.plan(1);
var aerr = new TypeError;
aerr.foo = 555;
aerr.bar = [1,2,3];

var berr = new TypeError('tuv');
berr.baz = 555;

var obj = [
new TypeError,
new TypeError('xxx'),
aerr, berr
];
t.equal(inspect(obj), '[' + [
'[TypeError]',
'[TypeError: xxx]',
'{ [TypeError: xxx] foo: 555, bar: [ 1, 2, 3 ] }',
'{ [TypeError: tuv] baz: 555 }',
].join(', ') + ']');
});

0 comments on commit 385b615

Please sign in to comment.