on 06-18-2020 2:56 PM
Dear All,
I am trying to test a .xsjs file via Unit Testing, but the test spec cannot locate the .xsjs file (please see attachment).
I have tried several alternatives:
require("attachments")
require("attachments.xsjs")
require("./attachments.xsjs")
require("../attachments.xsjs")
require("../../lib/attachments.xsjs")
etc..
Hopefully someone from the Community has come across this issue before and is able to help.
Many thanks
Regards
Pedro Espinosa
require, as you know it from Node.js, requires CommonJS modules. XSJS itself does not follow CommonJS and does not know the require function. XSJS has an own "module loader" (if you wanna call it so); it is the $.import function. Please check the docu and example here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.