source: imaps-frontend/node_modules/gopd/test/index.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: 590 bytes
RevLine 
[d565449]1'use strict';
2
3var test = require('tape');
4var gOPD = require('../');
5
6test('gOPD', function (t) {
7 t.test('supported', { skip: !gOPD }, function (st) {
8 st.equal(typeof gOPD, 'function', 'is a function');
9
10 var obj = { x: 1 };
11 st.ok('x' in obj, 'property exists');
12
13 var desc = gOPD(obj, 'x');
14 st.deepEqual(
15 desc,
16 {
17 configurable: true,
18 enumerable: true,
19 value: 1,
20 writable: true
21 },
22 'descriptor is as expected'
23 );
24
25 st.end();
26 });
27
28 t.test('not supported', { skip: gOPD }, function (st) {
29 st.notOk(gOPD, 'is falsy');
30
31 st.end();
32 });
33
34 t.end();
35});
Note: See TracBrowser for help on using the repository browser.