Trying to write a simple jest test using not_
and toThrow
to test that an expression or statement (originally a function call) call does NOT throw an error.
The original code under test is as follows, but simplified the example below to make it more clear.
I guess ideally I should not raise an error but use option with Some/None?
let handle = result =>
switch (result) {
| Some(v) => v
| None => raise(Not_found)
};
let write = () => LitHtml.html("<div></div>") |> handle;
Tells me that not_
and toThrow
are not bound. Using lates bs-platform
version 4.0.18
toEqual
however is bound. What could be the issue?
open Jest;
open Expect;
describe("Write", () =>
test("#html", () =>
expect("<div/>") |> not_ |> toThrow
)
);
describe("Calc", () =>
test("#add", () =>
expect(1 + 1) |> toEqual(1)
)
);