aboutsummaryrefslogtreecommitdiffstats
path: root/test/node_smoke_tests/document_missing.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/node_smoke_tests/document_missing.js')
-rw-r--r--test/node_smoke_tests/document_missing.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/node_smoke_tests/document_missing.js b/test/node_smoke_tests/document_missing.js
new file mode 100644
index 000000000..0a0bda350
--- /dev/null
+++ b/test/node_smoke_tests/document_missing.js
@@ -0,0 +1,19 @@
+/* jshint node: true */
+
+"use strict";
+
+var ensureGlobalNotCreated = require( "./lib/ensure_global_not_created" ),
+ jQueryFactory = require( "../../dist/jquery.js" );
+
+try {
+ jQueryFactory( {} );
+ console.error( "The jQuery factory should reject window without a document" );
+ process.exit( 1 );
+} catch ( e ) {
+ if ( e.message === "jQuery requires a window with a document" ) {
+ ensureGlobalNotCreated( module.exports );
+ process.exit( 0 );
+ }
+ console.error( "An unexpected error thrown; message: ", e.message );
+ process.exit( 1 );
+}