source: imaps-frontend/node_modules/has-proto/test/index.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 477 bytes
Line 
1'use strict';
2
3var test = require('tape');
4var hasProto = require('../');
5
6test('hasProto', function (t) {
7 var result = hasProto();
8 t.equal(typeof result, 'boolean', 'returns a boolean (' + result + ')');
9
10 var obj = { __proto__: null };
11 if (result) {
12 t.notOk('toString' in obj, 'null object lacks toString');
13 } else {
14 t.ok('toString' in obj, 'without proto, null object has toString');
15 t.equal(obj.__proto__, null); // eslint-disable-line no-proto
16 }
17
18 t.end();
19});
Note: See TracBrowser for help on using the repository browser.