aboutsummaryrefslogtreecommitdiffstats
path: root/test/node_smoke_tests/commonjs/factory/document_missing.cjs
blob: 2587c9989acad0f16b36a44827ab72092909e00e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"use strict";

const assert = require( "node:assert/strict" );

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 );