- Notifications
You must be signed in to change notification settings - Fork20.6k
Closed
Description
Congratulations on the release, the changes look good!
Description
According to thenpm package description, in order to use jQuery with JSDOM, you can now use a Factory:
const{JSDOM}=require("jsdom");const{ window}=newJSDOM("");const{ jQueryFactory}=require("jquery/factory");const$=jQueryFactory(window);
When the library is installed through npm:
npm install jquery@4.0.0-beta
The following files are available:
According to thepackage.json
, there should be a factory in thedist
anddist-module
folders:
Link to test case
This is an issue with the bundle itself, rather than some particular jQuery functionality, but the test is rather simple:
- Install the package via NPM.
- Create a simple
test.js
file with the following contents:
const { JSDOM } = require("jsdom");const { window } = new JSDOM();const { jQueryFactory } = require("jquery/factory");const $ = jQuery = jQueryFactory( window );console.log("success");
- And run it:
node test.js
I am guessing that the following array is the culprit:
https://github.com/jquery/jquery/blob/main/build/release/dist.js#L15