You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 590B

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