aboutsummaryrefslogtreecommitdiffstats
path: root/test/node_smoke_tests/commonjs/factory/document_missing.cjs
diff options
context:
space:
mode:
Diffstat (limited to 'test/node_smoke_tests/commonjs/factory/document_missing.cjs')
-rw-r--r--test/node_smoke_tests/commonjs/factory/document_missing.cjs15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/node_smoke_tests/commonjs/factory/document_missing.cjs b/test/node_smoke_tests/commonjs/factory/document_missing.cjs
new file mode 100644
index 000000000..e079912d8
--- /dev/null
+++ b/test/node_smoke_tests/commonjs/factory/document_missing.cjs
@@ -0,0 +1,15 @@
+"use strict";
+
+const assert = require( "node:assert" );
+
+const { ensureGlobalNotCreated } = require( "../lib/ensure_global_not_created.cjs" );
+const { getJQueryModuleSpecifier } = require( "../lib/jquery-module-specifier.cjs" );
+
+const jQueryModuleSpecifier = getJQueryModuleSpecifier();
+const { jQueryFactory } = require( jQueryModuleSpecifier );
+
+assert.throws( () => {
+ jQueryFactory( {} );
+}, /jQuery requires a window with a document/ );
+
+ensureGlobalNotCreated( module.exports );