I'm currently using typescript for client side development and java for server side (Maven Project). Now I'd like to create a @Parametrized JUnit test, which runs my typescript tests. For now i am compiling the Typescript into the target/test-classes folder and load them via ScriptRunner using eval. In case of an exception, you get the stack trace of the js file. Does anyone know a way to use the ts files (so tell nashorn to use the resource map)? I would also like to ask if you know any way of debugging this (like jumping between js/ts and java code) inside Eclipse.
No, nashorn supports //@sourceURL=foo [ and //#sourceURL=foo ] directive to set the source URL to be used for reported errors. Nashorn does not load/parse source maps. You need to explicitly map to source by reading javax.script.ScriptException or it's cause exception jdk.nashorn.api.scripting.NashornException in your embedding code.