source: imaps-frontend/node_modules/object.values/test/shimmed.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: 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.values.length, 1, 'Object.values has a length of 1');
14 t.test('Function name', { skip: !functionsHaveNames }, function (st) {
15 st.equal(Object.values.name, 'values', 'Object.values has name "values"');
16 st.end();
17 });
18
19 t.test('enumerability', { skip: !defineProperties.supportsDescriptors }, function (et) {
20 et.equal(false, isEnumerable.call(Object, 'values'), 'Object.values 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.values(undefined); }, TypeError, 'undefined is not an object');
28 st['throws'](function () { return Object.values(null); }, TypeError, 'null is not an object');
29 st.end();
30 });
31
32 runTests(Object.values, t);
33
34 t.end();
35});
Note: See TracBrowser for help on using the repository browser.