You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have a question: how should I import/export JavaScript functions/classes that are stored in helper files? My mock is created based on dynamically generated data, so I use JavaScript. To run the mock, I use the official Docker image. helper.js export function daysLeft(currentDate, secondDate){ var date1 = new Date(currentDate); var date2 = new Date(secondDate); var difference = date2.getTime() - date1.getTime(); return Math.ceil(difference / (1000 * 3600 * 24)); } response1.js import { daysLeft} from './helper.js';
error when running aused by: org.graalvm.polyglot.PolyglotException: ReferenceError: require is not defined at <js>.__run(Unnamed:17) ~[?:?] at org.graalvm.polyglot.Value.invokeMember(Value.java:971) ~[imposter.jar:?]
The text was updated successfully, but these errors were encountered:
Hi, I have a question: how should I import/export JavaScript functions/classes that are stored in helper files? My mock is created based on dynamically generated data, so I use JavaScript. To run the mock, I use the official Docker image.
helper.js
export function daysLeft(currentDate, secondDate){ var date1 = new Date(currentDate); var date2 = new Date(secondDate); var difference = date2.getTime() - date1.getTime(); return Math.ceil(difference / (1000 * 3600 * 24)); }
response1.js
import { daysLeft} from './helper.js';
error when running
aused by: org.graalvm.polyglot.PolyglotException: ReferenceError: require is not defined at <js>.__run(Unnamed:17) ~[?:?] at org.graalvm.polyglot.Value.invokeMember(Value.java:971) ~[imposter.jar:?]
The text was updated successfully, but these errors were encountered: