We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following has scripts in two files. The first has a dynamically created script and also sets a timeout. The second simply logs.
If you remove the script that's added dynamically, the timer fires after the second file is loaded (as expected).
var jsdom = require('jsdom'); var js1 = 'var script = document.createElement("script");' + 'script.src = "http://code.jquery.com/jquery-1.11.3.min.js";' + 'document.head.appendChild(script);' + 'console.log("first file loaded");' + 'setTimeout(function() { console.log("timeout running"); });'; var js2 = 'console.log("second file loaded");'; jsdom.env({ html: '<html><head></head><body></body></html>', src: [js1, js2], virtualConsole: jsdom.createVirtualConsole().sendTo(console), done: function() { // set a timeout so process doesn't exit until timeout runs setTimeout(function() {}, 100); } });
Expected output:
first file loaded second file loaded timeout running
Actual output:
first file loaded timeout running second file loaded
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following has scripts in two files. The first has a dynamically created script and also sets a timeout. The second simply logs.
If you remove the script that's added dynamically, the timer fires after the second file is loaded (as expected).
Expected output:
Actual output:
The text was updated successfully, but these errors were encountered: