main
Last change
on this file 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
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var test = require('tape');
|
---|
| 4 | var inspect = require('object-inspect');
|
---|
| 5 | var forEach = require('for-each');
|
---|
| 6 |
|
---|
| 7 | var isFinalizationRegistry = require('..');
|
---|
| 8 |
|
---|
| 9 | test('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.