Skip to content

Commit

Permalink
found a DC bug in 15.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tlhunter committed Sep 21, 2023
1 parent 9ebd9db commit 5e1b811
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions checks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const [ MAJOR, MINOR, PATCH ] = process.versions.node.split('.').map(Number);
module.exports.MAJOR = MAJOR;
module.exports.MINOR = MINOR;
module.exports.PATCH = PATCH;

function hasFullSupport() {
return MAJOR >= 20;
Expand Down
13 changes: 11 additions & 2 deletions test/test-diagnostics-channel-has-subscribers.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
'use strict';

require('./common.js');

const assert = require('assert');
const test = require('tape');

const { channel, hasSubscribers } = require('../dc-polyfill.js');

const { MAJOR, MINOR } = require('../checks.js');

test('test-diagnostics-channel-has-subscribers', t => {
if (MAJOR === 15 && MINOR === 1) {
// node:diagnostics_channel:110
// if (ref) channel = WeakRefPrototypeGet(ref);
// TypeError: WeakRefPrototypeGet is not a function
t.comment('SKIPPING TEST DUE TO A BUG IN THIS VERSION OF NODE.JS');
t.end();
return
}

const dc = channel('test-diagnostics-channel-has-subscribers');
t.ok(!hasSubscribers('test-diagnostics-channel-has-subscribers'));

Expand Down

0 comments on commit 5e1b811

Please sign in to comment.