why is the node application doesn't exit with jsdom?
See original GitHub issueHi all: I’m writing a node.js script to parse some html file with jsdom. The code looks like:
function parsingURL(file) {
var fs = require('fs');
var readFileSync = fs.readFileSync(file);
var jsdom = require('jsdom');
jsdom.env({
html: readFileSync,
scripts: ['http://code.jquery.com/jquery-1.11.2.min.js'],
done: function (errors, window) {
// free memory associated with the window
if (errors) {
console.info(errors);
} else {
console.info("success");
}
}
}
);
};
The “success” is printed as expected, but why the node application still hangs without exiting?
Issue Analytics
- State:
- Created 9 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
JSDOM - nodejs makes clean exit, doesn't load - Stack Overflow
I am trying to get the last step to work. I tried this initially with my own code as I am begining to...
Read more >How to Exit a Process in Node.js: process.exit() Method
There could be several reasons that a Node.js application terminates either automatically or sometimes you need to do it forcefully or manually.
Read more >jsdom - npm
jsdom. jsdom is a pure-JavaScript implementation of many web standards, notably the WHATWG DOM and HTML Standards, for use with Node.js.
Read more >Configuring Jest
To read TypeScript configuration files Jest requires ts-node . Make sure it is installed in your project. The configuration also can be stored ......
Read more >JSDOM: How to Get Started - Testim.io
By default JSDOM thinks the base URL for your application is about:blank. This can cause all sorts of testing errors inside your application,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Make sure you call
window.close()
in your done callback.While I don’t have much helpful to add, I’m seeing the same. After my callbacks are called, the process hangs for about two minutes until being killed. Code:
edit to add that my
then()
's are all called