Spaces:
Running
Running
File size: 590 Bytes
f9f0fec |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
'use strict';
var test = require('tape');
var gOPD = require('../');
test('gOPD', function (t) {
t.test('supported', { skip: !gOPD }, function (st) {
st.equal(typeof gOPD, 'function', 'is a function');
var obj = { x: 1 };
st.ok('x' in obj, 'property exists');
var desc = gOPD(obj, 'x');
st.deepEqual(
desc,
{
configurable: true,
enumerable: true,
value: 1,
writable: true
},
'descriptor is as expected'
);
st.end();
});
t.test('not supported', { skip: gOPD }, function (st) {
st.notOk(gOPD, 'is falsy');
st.end();
});
t.end();
});
|