Skip to content

Commit be1c8d7

Browse files
author
Daniel Wolf
committed
Printing the constructor name for non-plain objects
1 parent 71e24db commit be1c8d7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/typed.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
var inspect = require('../');
2+
var test = require('tape');
3+
4+
test('prototype is Object.prototype', function (t) {
5+
t.plan(1);
6+
var obj = {};
7+
t.equal(inspect(obj), '{}');
8+
});
9+
10+
test('prototype is null', function (t) {
11+
t.plan(1);
12+
var obj = Object.create(null);
13+
t.equal(inspect(obj), '{}');
14+
});
15+
16+
test('prototype from new', function (t) {
17+
t.plan(1);
18+
function Foo() {}
19+
var obj = new Foo();
20+
t.equal(inspect(obj), 'Foo {}');
21+
});

0 commit comments

Comments
 (0)