Skip to content

Commit

Permalink
test: add to runtest + fix bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
jchavarri committed Nov 22, 2023
1 parent 5a1127f commit b691ea4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/ReactDOMTestUtils.re
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module Simulate = {

external document: Dom.document = "document";

[@mel.send]
[@mel.return nullable] [@mel.send]
external querySelector: (Dom.element, string) => option(Dom.element) =
"querySelector";

Expand All @@ -94,7 +94,10 @@ external querySelectorAll:
"querySelectorAll";

[@mel.get] external textContent: Dom.element => string = "textContent";
[@mel.get] external body: Dom.document => option(Dom.element) = "body";

[@mel.return nullable] [@mel.get]
external body: Dom.document => option(Dom.element) = "body";

[@mel.send]
external createElement: (Dom.document, string) => Dom.element =
"createElement";
Expand Down
7 changes: 6 additions & 1 deletion test/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
(melange.emit
(alias runtest)
(alias jest)
(target test)
(module_systems
(commonjs bs.js))
(libraries reason-react reason-react.node jest melange.belt)
(preprocess
(pps melange.ppx reason-react-ppx)))

(rule
(alias runtest)
(deps (alias_rec jest))
(action (run npx jest)))

0 comments on commit b691ea4

Please sign in to comment.