Detailed Description
The client side object's name can be set in the builder's settings (obj_name) or per request (query.fod-js-object-name). The name is written into the script as a variable name, a session storage key and a property name, so these tests check that a different name works, and that a name which is not a JavaScript identifier is never written into the script. The script is checked with "node --check" and run in Node with a minimal stand in for a browser (object_name_harness.js). Both need Node on the path, which every GitHub hosted runner has.
Classes | |
| class | JavaScriptBuilderObjectNameTests |
| class | JavaScriptBuilderObjectNameSettingTests |
Functions | |
| _render (settings=None, evidence=None, logger=None) | |
| _write (script) | |
| _node (*args) | |
| _declared_names (script) | |
Variables | |
| NODE = shutil.which("node") | |
| HARNESS = os.path.join(os.path.dirname(__file__), "object_name_harness.js") | |
Function Documentation
◆ _declared_names()
|
protected |
◆ _node()
|
protected |
◆ _render()
|
protected |
Render the script for one request and return it.
◆ _write()
|
protected |
Variable Documentation
◆ HARNESS
| tests.test_javascriptbuilder_object_name.HARNESS = os.path.join(os.path.dirname(__file__), "object_name_harness.js") |
◆ NODE
| tests.test_javascriptbuilder_object_name.NODE = shutil.which("node") |
