Skip to Content
Aug 19, 2020 at 03:32 PM

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!


sap-1.png (8.8 kB)
sap-2.jpg (25.4 kB)
sap-3.jpg (29.7 kB)