Description
Edited: Here's how to fix this: #20756 (comment).
React version: 17.0.1 (latest)
Steps To Reproduce
This code finishes properly in node.js 14, but holds the process open in node.js 15
global.window = global; // simulate JSDOM
require('scheduler');
Since node.js 15, there is a global MessageChannel
object now, which prevents node event loop from exiting. To let the process shut down properly, it should either call port.close()
or port.unref()
This becomes an issue when testing React code within JSDOM environment, as the test process cannot exit properly.
The current behavior
The process with JSDOM tests never finishes
The expected behavior
The process finishes properly
Activity