aboutsummaryrefslogtreecommitdiffstats
path: root/backend/node_modules/gopd/test
diff options
context:
space:
mode:
Diffstat (limited to 'backend/node_modules/gopd/test')
-rw-r--r--backend/node_modules/gopd/test/index.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/backend/node_modules/gopd/test/index.js b/backend/node_modules/gopd/test/index.js
new file mode 100644
index 0000000..0376bfb
--- /dev/null
+++ b/backend/node_modules/gopd/test/index.js
@@ -0,0 +1,35 @@
+'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();
+});