Test a JS module
You can test the JS module by running it for a selected guest. We recommend testing the module before you publish it, to identify any errors and ensure optimal performance. After changing the code, re-test the module with the same guest to check the results.
Since the JS module is only part of a larger piece of functionality (for example, some functions imported into a programmable decision), you might prefer to copy the JS module code, paste it into a draft programmable decision, and test it there.
Team members with a User, Developer, or Admin role in Sitecore Cloud Portal can test a JS module.
To test a JS module:
-
Open the JS module and click Edit
. -
In the code editor, click Test.
-
In the Test JS module dialog, you can test against the default guest's attributes, or click in the search box and choose Recent to select from a list of recently active guests or Bookmarks to select from a list of bookmarked guests. The system selects a guest who was recently active. You can search for a guest using, for example, an email address, other unique identifier or browser ID.
NoteIf there is a guest whose data you often use when configuring or testing code, just click the star icon to bookmark the guest so you no longer have to search for them.
-
Click Test. The module runs as it would in production, against the data of the selected guest. The output of the module displays on the Response tab.