overte-thingvellir/tests/script-engine/src/networked_tests/004_require.js
Dale Glass 02a0e33e95 Add NETWORKLESS_TEST_SCRIPT type to NetworkManager.
This is a slightly hacky way to make ScriptManager work without any
networking, and minimize the number of dependencies needed to run
a test.
2023-05-19 00:17:38 +02:00

11 lines
613 B
JavaScript

print("Script.require: " + JSON.stringify(Script.require));
print("Script.require.cache: " + JSON.stringify(Script.require.cache));
print(JSON.stringify("Script.require.test_prop before defining: " + Script.require.test_prop));
Script.require.test_prop = "test property";
print(JSON.stringify("Script.require.test_prop after defining: " + Script.require.test_prop));
print("Before require");
// TODO: find correct local path for the test module
requireTest = Script.require("http://oaktown.pl/scripts/004b_require_module.js");
print("After require");
requireTest.moduleFunction1();
requireTest.moduleFunction2();