1 | 'use strict';
|
---|
2 |
|
---|
3 | require('../auto');
|
---|
4 |
|
---|
5 | var test = require('tape');
|
---|
6 | var defineProperties = require('define-properties');
|
---|
7 | var isEnumerable = Object.prototype.propertyIsEnumerable;
|
---|
8 | var functionsHaveNames = require('functions-have-names')();
|
---|
9 |
|
---|
10 | var runTests = require('./tests');
|
---|
11 |
|
---|
12 | test('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 | });
|
---|