aboutsummaryrefslogtreecommitdiffstats
path: root/test/node_smoke_tests/module/lib/ensure_global_not_created.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/node_smoke_tests/module/lib/ensure_global_not_created.js')
-rw-r--r--test/node_smoke_tests/module/lib/ensure_global_not_created.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/node_smoke_tests/module/lib/ensure_global_not_created.js b/test/node_smoke_tests/module/lib/ensure_global_not_created.js
new file mode 100644
index 000000000..d7648bd68
--- /dev/null
+++ b/test/node_smoke_tests/module/lib/ensure_global_not_created.js
@@ -0,0 +1,11 @@
+import assert from "node:assert";
+
+// Ensure the jQuery property on global/window/module "this"/etc. was not
+// created in a CommonJS environment.
+// `global` is always checked in addition to passed parameters.
+export const ensureGlobalNotCreated = ( ...args ) => {
+ [ ...args, global ].forEach( function( object ) {
+ assert.strictEqual( object.jQuery, undefined,
+ "A jQuery global was created in a module environment." );
+ } );
+};