File tree Expand file tree Collapse file tree 3 files changed +25
-21
lines changed Expand file tree Collapse file tree 3 files changed +25
-21
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ let make = () => {
2828 <a className = "App-link" href = "https://reactjs.org" target = "_blank" rel = "noopener noreferrer" >
2929 {React .string ("Learn React" )}
3030 </a >
31- <a className = "App-link" href = "https://rescript-lang.org/" target = "_blank" rel = "noopener noreferrer" >
31+ <a
32+ className = "App-link"
33+ href = "https://rescript-lang.org/"
34+ target = "_blank"
35+ rel = "noopener noreferrer" >
3236 {React .string ("Learn ReScript" )}
3337 </a >
3438 </header >
Original file line number Diff line number Diff line change 1- type assertions
2- type result
1+ open TestBindings .Mocha
2+ open TestBindings .Chai
3+ open TestBindings .ReactTestingLibrary
34
4- @module ("@testing-library/react" ) external render : React .element => result = "render"
5-
6- @module ("@testing-library/react" ) external getNodeText : Dom .element => string = "getNodeText"
7-
8- @module ("@testing-library/react" ) @val external screen : result = "screen"
9-
10- @send external getByText : (result , string ) => Dom .element = "getByText"
11-
12- @module ("chai" ) external chaiAssert : assertions = "assert"
13-
14- @send external equal : (assertions , 'a , 'a ) => unit = "equal"
15-
16- @val external it : (string , @uncurry (unit => unit )) => unit = "it"
17-
18- it ("renders learn react link" , () => {
5+ it ("renders learn React and ReScript link" , () => {
196 let _ = render (<App />)
20- let actual = screen -> getByText ("Learn React" )-> getNodeText
21- let expected = "Learn React"
22- chaiAssert -> equal (actual , expected )
7+ screen -> getByText ("Learn React" )-> isOk
8+ screen -> getByText ("Learn ReScript" )-> isOk
239})
Original file line number Diff line number Diff line change 1+ module ReactTestingLibrary = {
2+ type renderResult
3+ @module ("@testing-library/react" ) external render : React .element => renderResult = "render"
4+ @module ("@testing-library/react" ) @val external screen : renderResult = "screen"
5+ @send external getByText : (renderResult , string ) => Dom .element = "getByText"
6+ }
7+
8+ module Chai = {
9+ @module ("chai" ) @scope ("assert" ) external isOk : 'a => unit = "isOk"
10+ }
11+
12+ module Mocha = {
13+ @val external it : (string , @uncurry (unit => unit )) => unit = "it"
14+ }
You can’t perform that action at this time.
0 commit comments