Core: Fix the exports setup to make bundlers work with ESM & CommonJS
[jquery.git] / test / node_smoke_tests / commonjs / lib / ensure_global_not_created.cjs
blobde27739ebdfb951c6529ff72c93ddc4144075cb1
1 "use strict";
3 const assert = require( "node:assert/strict" );
5 // Ensure the jQuery property on global/window/module.exports/etc. was not
6 // created in a CommonJS environment.
7 // `global` is always checked in addition to passed parameters.
8 const ensureGlobalNotCreated = ( ...args ) => {
9         [ ...args, global ].forEach( function( object ) {
10                 assert.strictEqual( object.jQuery, undefined,
11                         "A jQuery global was created in a CommonJS environment." );
12         } );
15 module.exports = { ensureGlobalNotCreated };