@@ -6,6 +6,7 @@ var test_paths = {
6
6
js_commonjs : "file:///" + process . env . test_env_root + "/basic_content/test_js_commonjs.js" ,
7
7
reference_clientside_require : "file:///" + process . env . test_env_root + "/test_js/reference_clientside_require_in_module.js" ,
8
8
reference_window : "file:///" + process . env . test_env_root + "/test_js/reference_window_in_module.js" ,
9
+ reference_env : "file:///" + process . env . test_env_root + "/test_js/reference_env_in_module.js" ,
9
10
reference_load : "file:///" + process . env . test_env_root + "/test_js/reference_load_in_module.js" ,
10
11
reference_require : "file:///" + process . env . test_env_root + "/test_js/reference_require_in_module.js" ,
11
12
reference_root_window : "file:///" + process . env . test_env_root + "/test_js/reference_root_window_in_module.js" ,
@@ -74,28 +75,34 @@ describe('commonjs', function(){
74
75
assert . equal ( typeof exports , "object" , "window should be defined" ) ;
75
76
assert . equal ( typeof exports . document , "object" , "window.document should be defined" ) ;
76
77
} )
77
- it ( "should define window.clientside_require in the modules environment" , async function ( ) {
78
+ it ( 'should define env in the modules environment' , async function ( ) {
79
+ var commonjs_loader = require ( process . env . src_root + "/utilities/content_loading/commonjs.js" ) ;
80
+ var exports = await commonjs_loader . promise_to_retreive_exports ( test_paths . reference_env , "async" ) ;
81
+ assert . equal ( typeof exports , "object" , "env should be defined" ) ;
82
+ assert . equal ( typeof exports . document , "object" , "env.document should be defined" ) ;
83
+ } )
84
+ it ( "should define env.clientside_require in the modules environment" , async function ( ) {
78
85
var commonjs_loader = require ( process . env . src_root + "/utilities/content_loading/commonjs.js" ) ;
79
86
var exports = await commonjs_loader . promise_to_retreive_exports ( test_paths . reference_clientside_require , "async" ) ;
80
87
assert . equal ( typeof exports , "object" , "window.clientside_require should be defined" ) ;
81
88
assert . equal ( typeof exports . asynchronous_require , "function" , "window.clientside_require.asynchronous_require should be defined" ) ;
82
89
} )
83
- it ( 'should define window .require in the modules environment' , async function ( ) {
90
+ it ( 'should define env .require in the modules environment' , async function ( ) {
84
91
var commonjs_loader = require ( process . env . src_root + "/utilities/content_loading/commonjs.js" ) ;
85
92
var exports = await commonjs_loader . promise_to_retreive_exports ( test_paths . reference_load , "async" ) ;
86
93
assert . equal ( typeof exports , "function" , "require method should be defined" ) ;
87
94
} )
88
- it ( 'should define window .load in the modules environment' , async function ( ) {
95
+ it ( 'should define env .load in the modules environment' , async function ( ) {
89
96
var commonjs_loader = require ( process . env . src_root + "/utilities/content_loading/commonjs.js" ) ;
90
97
var exports = await commonjs_loader . promise_to_retreive_exports ( test_paths . reference_require , "async" ) ;
91
98
assert . equal ( typeof exports , "function" , "load method should be defined" ) ;
92
99
} )
93
- it ( 'should define window .root_window in the modules environment' , async function ( ) {
100
+ it ( 'should define env .root_window in the modules environment' , async function ( ) {
94
101
var commonjs_loader = require ( process . env . src_root + "/utilities/content_loading/commonjs.js" ) ;
95
102
var exports = await commonjs_loader . promise_to_retreive_exports ( test_paths . reference_root_window , "async" ) ;
96
103
assert . equal ( typeof exports , "object" , "root_window should be defined" ) ;
97
104
} )
98
- it ( 'should define window .location in the modules environment accurately' , async function ( ) {
105
+ it ( 'should define env .location in the modules environment accurately' , async function ( ) {
99
106
var commonjs_loader = require ( process . env . src_root + "/utilities/content_loading/commonjs.js" ) ;
100
107
var exports = await commonjs_loader . promise_to_retreive_exports ( test_paths . reference_location , "async" ) ;
101
108
assert . equal ( typeof exports , "object" , "location should be defined" ) ;
0 commit comments