diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:31:11 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:31:11 +0800 |
| commit | aa773172311dcada759dfbaac485f4bc6e00bc21 (patch) | |
| tree | ca6d9a5eff3ab8f689f9acb4f0df791d9486813d /node_modules/has/test | |
| parent | c5a5384e846f242e901e859fe600d695d8990a9a (diff) | |
added babel
Diffstat (limited to 'node_modules/has/test')
| -rw-r--r-- | node_modules/has/test/index.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/node_modules/has/test/index.js b/node_modules/has/test/index.js new file mode 100644 index 00000000..876aad91 --- /dev/null +++ b/node_modules/has/test/index.js @@ -0,0 +1,16 @@ +'use strict'; + +var test = require('tape'); +var has = require('../'); + +test('has', function (t) { + t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"'); + t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"'); + t['throws'](function () { + has(null, 'throws'); + }, TypeError, 'calling has on null throws TypeError'); + t['throws'](function () { + has(void 0, 'throws'); + }, TypeError, 'calling has on undefined throws TypeError'); + t.end(); +}); |
