source: imaps-frontend/node_modules/object.entries/test/shimmed.js@ d565449

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

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[d565449]1'use strict';
2
3require('../auto');
4
5var test = require('tape');
6var defineProperties = require('define-properties');
7var isEnumerable = Object.prototype.propertyIsEnumerable;
8var functionsHaveNames = require('functions-have-names');
9
10var runTests = require('./tests');
11
12test('shimmed', function (t) {
13 t.equal(Object.entries.length, 1, 'Object.entries has a length of 1');
14 t.test('Function name', { skip: !functionsHaveNames }, function (st) {
15 st.equal(Object.entries.name, 'entries', 'Object.entries has name "entries"');
16 st.end();
17 });
18
19 t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
20 et.equal(false, isEnumerable.call(Object, 'entries'), 'Object.entries is not enumerable');
21 et.end();
22 });
23
24 var supportsStrictMode = (function () { return typeof this === 'undefined'; }());
25
26 t.test('bad object value', { skip: !supportsStrictMode }, function (st) {
27 st['throws'](function () { return Object.entries(undefined); }, TypeError, 'undefined is not an object');
28 st['throws'](function () { return Object.entries(null); }, TypeError, 'null is not an object');
29 st.end();
30 });
31
32 runTests(Object.entries, t);
33
34 t.end();
35});
Note: See TracBrowser for help on using the repository browser.