diff options
Diffstat (limited to 'test/node_smoke_tests/module/factory/document_missing.js')
-rw-r--r-- | test/node_smoke_tests/module/factory/document_missing.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/node_smoke_tests/module/factory/document_missing.js b/test/node_smoke_tests/module/factory/document_missing.js new file mode 100644 index 000000000..ccb3383ad --- /dev/null +++ b/test/node_smoke_tests/module/factory/document_missing.js @@ -0,0 +1,13 @@ +import assert from "node:assert"; + +import { ensureGlobalNotCreated } from "../lib/ensure_global_not_created.js"; +import { getJQueryModuleSpecifier } from "../lib/jquery-module-specifier.js"; + +const jQueryModuleSpecifier = getJQueryModuleSpecifier(); +const { jQueryFactory } = await import( jQueryModuleSpecifier ); + +assert.throws( () => { + jQueryFactory( {} ); +}, /jQuery requires a window with a document/ ); + +ensureGlobalNotCreated(); |