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
They use let _ = blah() which means if the type of a method changes the test still compiles. This is not good.
By always using _ to avoid exporting the reference, some lines are optimised away by ReScript and never emitted (this is arguably a bug, but it's what we are stuck with for now).
The more I think about this the more I believe it should be logged as a bug with ReScript. But we should find them all first to make the bug report more valuable.
The text was updated successfully, but these errors were encountered:
I made them export a reference in a PR so I changed let _ = range->getClientRects to let rects = range->getClientRects that way the compiler will not throw them away I don't mind it adding a export to the test module no one will include that directly anyway we just make sure they are not shipped in the npm package.
So maybe we switch it to this: let clientRects: array<Dom.domRect> = range->getClientRects ?
I have started a branch for this, there's a lot to do, but I've nearly covered the 10 files in the top-level webapi folder. I'm not looking forward to updating the dom folder 😂
There are two problems with our tests:
let _ = blah()
which means if the type of a method changes the test still compiles. This is not good._
to avoid exporting the reference, some lines are optimised away by ReScript and never emitted (this is arguably a bug, but it's what we are stuck with for now).To solve the first problem, change things like
to
For the second, about all we can do is audit the JS and see which lines don't result in compiled output. I have found that externals returning an optional value in a
let _ =
line are not emitted, here's how I solved that:https://github.com/tinymce/rescript-webapi/blob/b138ae2982d24193473e01929251871ea2d4ba65/tests/Webapi/Dom/Webapi__Dom__Document__test.res#L64-L67
The more I think about this the more I believe it should be logged as a bug with ReScript. But we should find them all first to make the bug report more valuable.
The text was updated successfully, but these errors were encountered: