mpetuska / klip

Kotlin Multiplatform snapshot ((c|k)lip) manager for tests.
https://mpetuska.github.io/klip
24 stars 1 forks source link

HTTP Server to manage klips for browser runtime #21

Closed mpetuska closed 2 years ago

mpetuska commented 2 years ago

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.