jquery/test/node_smoke_tests/document_present_originally.js
Michał Gołębiowski-Owczarek 9cb124ed00
Build: Update jsdom; migrate a test with Symbol polyfill to an iframe test
So far, we've been testing that jQuery element iteration works with polyfilled
Symbol & transpiled for-of via a Node test with jsdom with the Symbol global
removed. Unfortunately, jsdom now requires Symbol to be present for its internal
functionality so such a test is no longer possible. Instead, it's been migrated
to an iframe test with transpiled JavaScript.

This PR also enables us to use ECMAScript 2017 or newer in Node.js code.

Closes gh-4305
2019-03-04 18:30:51 +01:00

16 lines
408 B
JavaScript

"use strict";
const { JSDOM } = require( "jsdom" );
const { window } = new JSDOM( "" );
// Pretend the window is a global.
global.window = window;
const ensureJQuery = require( "./lib/ensure_jquery" );
const ensureGlobalNotCreated = require( "./lib/ensure_global_not_created" );
const jQuery = require( "../../dist/jquery.js" );
ensureJQuery( jQuery );
ensureGlobalNotCreated( module.exports, window );