source: imaps-frontend/node_modules/is-finalizationregistry/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: 929 bytes
Line 
1'use strict';
2
3var test = require('tape');
4var inspect = require('object-inspect');
5var forEach = require('for-each');
6
7var isFinalizationRegistry = require('..');
8
9test('isFinalizationRegistry', function (t) {
10 t.equal(typeof isFinalizationRegistry, 'function', 'is a function');
11
12 var nonFinalizationRegistries = [undefined, null, true, false, 42, 0, Infinity, NaN, /a/g, function () {}, {}, []];
13 forEach(nonFinalizationRegistries, function (nonFinalizationRegistry) {
14 t.equal(isFinalizationRegistry(nonFinalizationRegistry), false, inspect(nonFinalizationRegistry) + ' is not a FinalizationRegistry');
15 });
16
17 t.test('actual FinalizationRegistry instances', { skip: typeof FinalizationRegistry === 'undefined' }, function (st) {
18 var registry = new FinalizationRegistry(function () {});
19
20 st.equal(isFinalizationRegistry(registry), true, inspect(registry) + ' is a FinalizationRegistry');
21
22 st.end();
23 });
24
25 t.end();
26});
Note: See TracBrowser for help on using the repository browser.