Since js tests running on the browser runtime do not have access to fs module, an alternative way to write to files is required.
This can be solved by implementing a simple HTTP server managed by gradle and tied to jsBrowserTest tasks lifecycle, that would manage klip files via fetch API.
This should be toggled by a new flag injected by the compiler (defaults to true only for js sourceSets). Alternatively, this could be detected implicitly in klip-core and only enable itself if browser runtime is detected.
Since js tests running on the browser runtime do not have access to
fs
module, an alternative way to write to files is required.This can be solved by implementing a simple HTTP server managed by gradle and tied to
jsBrowserTest
tasks lifecycle, that would manage klip files viafetch
API.This should be toggled by a new flag injected by the compiler (defaults to true only for js sourceSets). Alternatively, this could be detected implicitly in klip-core and only enable itself if browser runtime is detected.