scala-webapp-template
scala-webapp-template copied to clipboard
Remove SecureRandom patch after the upgrade to scala.js to 1.10.0
Upgrading has some tricky details (https://www.scala-js.org/news/2022/04/04/announcing-scalajs-1.10.0/) because we need to use the secure random library for running the app but the insecure one for tests, this occurs because the test environment doesn't have the crypto modules available.
We need either:
- A way to replace the secure random with the insecure one for testing.
- A way to switch our test environment so that it has the crypto modules available.
The problem is that our js transitive dependencies bring https://github.com/crypto-browserify/randomfill/blob/master/browser.js which doesn't seem to allow generating random numbers in our jsdom environment (see).
I ended up adding a minor local patch to https://github.com/scala-js/scala-js-fake-insecure-java-securerandom for solving the problem, it is ideal to eventually get rid of this patch.