Showing results for 
Search instead for 
Did you mean: 

Unit Testing with XSJS. Correct approach?


Scenario: We’re trying to test our files with the integrated unit testing provided by the WebIDE.

doesFileExist.xsjs: This file is called to check if a file exists (/doesFileExist.xsjs?file=FILENAME.PDF).

doesFileExist.xsjslib: Provides the functionality for doesFileExist.xsjs (library).

doesFileExistTest.xsjslib: Test function for doesFileExist.xsjslib

Question: Unfortunately we don’t know if our approach is correct, nor if it’s best practice. Is it really necessary to create this many files? Are there any improvements we could take?

Many thanks in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Product and Topic Expert
Product and Topic Expert
0 Kudos


This is my experience in XSJS.. Keep your filename column in a table and then call the select statement in javascript function to check. so with this less dependency and lines of code.