@@ -6,50 +6,52 @@ let () = {
6
6
describe ("Expect" , () => {
7
7
open Expect
8
8
9
- test ("toBe" , () => expect (1 + 2 ) -> toBe (3 ))
10
- test ("toBeCloseTo" , () => expect (1 . +. 2 .) -> toBeCloseTo (3 .))
11
- test ("toBeSoCloseTo" , () => expect (1 . +. 2.123 ) -> toBeSoCloseTo (3.123 , ~digits = 3 ))
12
- test ("toBeGreaterThan" , () => expect (4 ) -> toBeGreaterThan (3 ))
13
- test ("toBeGreaterThanOrEqual" , () => expect (4 ) -> toBeGreaterThanOrEqual (4 ))
14
- test ("toBeLessThan" , () => expect (4 ) -> toBeLessThan (5 ))
15
- test ("toBeLessThanOrEqual" , () => expect (4 ) -> toBeLessThanOrEqual (4 ))
16
- test ("toBeSuperSetOf" , () => expect (["a" , "b" , "c" ]) -> toBeSupersetOf (["a" , "c" ]))
17
- test ("toContain" , () => expect (["a" , "b" , "c" ]) -> toContain ("b" ))
18
- test ("toContainEqual" , () => expect ([{value : "a" }, {value : "b" }, {value : "c" }]) -> toContainEqual ({value : "b" })
9
+ test ("toBe" , () => expect (1 + 2 )-> toBe (3 ))
10
+ test ("toBeCloseTo" , () => expect (1 . +. 2 .)-> toBeCloseTo (3 .))
11
+ test ("toBeSoCloseTo" , () => expect (1 . +. 2.123 )-> toBeSoCloseTo (3.123 , ~digits = 3 ))
12
+ test ("toBeGreaterThan" , () => expect (4 )-> toBeGreaterThan (3 ))
13
+ test ("toBeGreaterThanOrEqual" , () => expect (4 )-> toBeGreaterThanOrEqual (4 ))
14
+ test ("toBeLessThan" , () => expect (4 )-> toBeLessThan (5 ))
15
+ test ("toBeLessThanOrEqual" , () => expect (4 )-> toBeLessThanOrEqual (4 ))
16
+ test ("toBeSuperSetOf" , () => expect (["a" , "b" , "c" ])-> toBeSupersetOf (["a" , "c" ]))
17
+ test ("toContain" , () => expect (["a" , "b" , "c" ])-> toContain ("b" ))
18
+ test ("toContainEqual" , () =>
19
+ expect ([{value : "a" }, {value : "b" }, {value : "c" }])-> toContainEqual ({value : "b" })
19
20
)
20
- test ("toContainString" , () => expect ("banana" ) -> toContainString ("nana" ))
21
- test ("toHaveLength" , () => expect (["a" , "b" , "c" ]) -> toHaveLength (3 ))
22
- test ("toEqual" , () => expect (1 + 2 ) -> toEqual (3 ))
23
- test ("toMatch" , () => expect ("banana" ) -> toMatch ("nana" ))
24
- test ("toMatchRe" , () => expect ("banana" ) -> toMatchRe (%re ("/ana/" )))
25
- test ("toThrow" , () => expect (() => assert false ) -> toThrow )
21
+ test ("toContainString" , () => expect ("banana" )-> toContainString ("nana" ))
22
+ test ("toHaveLength" , () => expect (["a" , "b" , "c" ])-> toHaveLength (3 ))
23
+ test ("toEqual" , () => expect (1 + 2 )-> toEqual (3 ))
24
+ test ("toMatch" , () => expect ("banana" )-> toMatch ("nana" ))
25
+ test ("toMatchRe" , () => expect ("banana" )-> toMatchRe (%re ("/ana/" )))
26
+ test ("toThrow" , () => expect (() => assert false )-> toThrow )
26
27
27
- test ("toMatchInlineSnapshot" , () => expect ("foo" ) -> toMatchInlineSnapshot ("\" foo\" " ))
28
- test ("toMatchSnapshot" , () => expect ("foo" ) -> toMatchSnapshot )
29
- test ("toMatchSnapshotWithName" , () => expect ("foo" ) -> toMatchSnapshotWithName ("bar" ))
28
+ test ("toMatchInlineSnapshot" , () => expect ("foo" )-> toMatchInlineSnapshot ("\" foo\" " ))
29
+ test ("toMatchSnapshot" , () => expect ("foo" )-> toMatchSnapshot )
30
+ test ("toMatchSnapshotWithName" , () => expect ("foo" )-> toMatchSnapshotWithName ("bar" ))
30
31
test ("toThrowErrorMatchingSnapshot" , () =>
31
- expect (() => Js .Exn .raiseError ("foo error" )) -> toThrowErrorMatchingSnapshot
32
+ expect (() => Js .Exn .raiseError ("foo error" ))-> toThrowErrorMatchingSnapshot
32
33
)
33
34
34
- test ("not toBe" , () => expect (1 + 2 ) -> not_ -> toBe (4 ))
35
- test ("not toBeCloseTo" , () => expect (1 . +. 2 .) -> not_ -> toBeCloseTo (3001 .))
36
- test ("not toBeSoCloseTo" , () => expect (1 . +. 2.123 ) -> not_ -> toBeSoCloseTo (3.124 , ~digits = 3 , ))
37
- test ("not toBeGreaterThan" , () => expect (4 ) -> not_ -> toBeGreaterThan (4 ))
38
- test ("not toBeGreaterThanOrEqual" , () => expect (4 ) -> not_ -> toBeGreaterThanOrEqual (5 ))
39
- test ("not toBeLessThan" , () => expect (4 ) -> not_ -> toBeLessThan (4 ))
40
- test ("not toBeLessThanOrEqual" , () => expect (4 ) -> not_ -> toBeLessThanOrEqual (3 ))
41
- test ("not toBeSuperSetOf" , () => expect (["a" , "b" , "c" ]) -> not_ -> toBeSupersetOf (["a" , "d" ]))
42
- test ("not toContain" , () => expect (["a" , "b" , "c" ]) -> not_ -> toContain ("d" ))
43
- test ("not toContainEqual" , () => expect ([{value : "a" }, {value : "b" }, {value : "c" }]) -> not_ -> toContainEqual ({value : "d" })
35
+ test ("not toBe" , () => expect (1 + 2 )-> not_ -> toBe (4 ))
36
+ test ("not toBeCloseTo" , () => expect (1 . +. 2 .)-> not_ -> toBeCloseTo (3001 .))
37
+ test ("not toBeSoCloseTo" , () => expect (1 . +. 2.123 )-> not_ -> toBeSoCloseTo (3.124 , ~digits = 3 ))
38
+ test ("not toBeGreaterThan" , () => expect (4 )-> not_ -> toBeGreaterThan (4 ))
39
+ test ("not toBeGreaterThanOrEqual" , () => expect (4 )-> not_ -> toBeGreaterThanOrEqual (5 ))
40
+ test ("not toBeLessThan" , () => expect (4 )-> not_ -> toBeLessThan (4 ))
41
+ test ("not toBeLessThanOrEqual" , () => expect (4 )-> not_ -> toBeLessThanOrEqual (3 ))
42
+ test ("not toBeSuperSetOf" , () => expect (["a" , "b" , "c" ])-> not_ -> toBeSupersetOf (["a" , "d" ]))
43
+ test ("not toContain" , () => expect (["a" , "b" , "c" ])-> not_ -> toContain ("d" ))
44
+ test ("not toContainEqual" , () =>
45
+ expect ([{value : "a" }, {value : "b" }, {value : "c" }])-> not_ -> toContainEqual ({value : "d" })
44
46
)
45
- test ("not toContainString" , () => expect ("banana" ) -> not_ -> toContainString ("nanan" ))
46
- test ("not toHaveLength" , () => expect (["a" , "b" , "c" ]) -> not_ -> toHaveLength (2 ))
47
- test ("not toEqual" , () => expect (1 + 2 ) -> not_ -> toEqual (4 ))
48
- test ("not toMatch" , () => expect ("banana" ) -> not_ -> toMatch ("nanan" ))
49
- test ("not toMatchRe" , () => expect ("banana" ) -> not_ -> toMatchRe (%re ("/anas/" )))
50
- test ("not toThrow" , () => expect (() => 2 ) -> not_ -> toThrow )
47
+ test ("not toContainString" , () => expect ("banana" )-> not_ -> toContainString ("nanan" ))
48
+ test ("not toHaveLength" , () => expect (["a" , "b" , "c" ])-> not_ -> toHaveLength (2 ))
49
+ test ("not toEqual" , () => expect (1 + 2 )-> not_ -> toEqual (4 ))
50
+ test ("not toMatch" , () => expect ("banana" )-> not_ -> toMatch ("nanan" ))
51
+ test ("not toMatchRe" , () => expect ("banana" )-> not_ -> toMatchRe (%re ("/anas/" )))
52
+ test ("not toThrow" , () => expect (() => 2 )-> not_ -> toThrow )
51
53
52
- test ("expectFn" , () => expectFn (raise , Invalid_argument ("foo" )) -> toThrow )
54
+ test ("expectFn" , () => expectFn (raise , Invalid_argument ("foo" ))-> toThrow )
53
55
})
54
56
55
57
describe ("Expect.Operators" , () => {
@@ -69,26 +71,26 @@ let () = {
69
71
describe ("ExpectJs" , () => {
70
72
open ExpectJs
71
73
72
- test ("toBeDefined" , () => expect (Js .Undefined .return (3 )) -> toBeDefined )
73
- test ("toBeFalsy" , () => expect (nan ) -> toBeFalsy )
74
- test ("toBeNull" , () => expect (Js .null ) -> toBeNull )
75
- test ("toBeTruthy" , () => expect ([]) -> toBeTruthy )
76
- test ("toBeUndefined" , () => expect (Js .Undefined .empty ) -> toBeUndefined )
74
+ test ("toBeDefined" , () => expect (Js .Undefined .return (3 ))-> toBeDefined )
75
+ test ("toBeFalsy" , () => expect (nan )-> toBeFalsy )
76
+ test ("toBeNull" , () => expect (Js .null )-> toBeNull )
77
+ test ("toBeTruthy" , () => expect ([])-> toBeTruthy )
78
+ test ("toBeUndefined" , () => expect (Js .Undefined .empty )-> toBeUndefined )
77
79
test ("toContainProperties" , () =>
78
- expect ({"foo" : 0 , "bar" : true }) -> toContainProperties (["foo" , "bar" ])
80
+ expect ({"foo" : 0 , "bar" : true })-> toContainProperties (["foo" , "bar" ])
79
81
)
80
- test ("toMatchObject" , () => expect ({"a" : 1 , "b" : 2 , "c" : 3 }) -> toMatchObject ({"a" : 1 , "b" : 2 }))
82
+ test ("toMatchObject" , () => expect ({"a" : 1 , "b" : 2 , "c" : 3 })-> toMatchObject ({"a" : 1 , "b" : 2 }))
81
83
82
- test ("not toBeDefined" , () => expect (Js .undefined ) -> not_ -> toBeDefined )
83
- test ("not toBeFalsy" , () => expect ([]) -> not_ -> toBeFalsy )
84
- test ("not toBeNull" , () => expect (Js .Null .return (4 )) -> not_ -> toBeNull )
85
- test ("not toBeTruthy" , () => expect (nan ) -> not_ -> toBeTruthy )
86
- test ("not toBeUndefined" , () => expect (Js .Undefined .return (4 )) -> not_ -> toBeUndefined )
84
+ test ("not toBeDefined" , () => expect (Js .undefined )-> not_ -> toBeDefined )
85
+ test ("not toBeFalsy" , () => expect ([])-> not_ -> toBeFalsy )
86
+ test ("not toBeNull" , () => expect (Js .Null .return (4 ))-> not_ -> toBeNull )
87
+ test ("not toBeTruthy" , () => expect (nan )-> not_ -> toBeTruthy )
88
+ test ("not toBeUndefined" , () => expect (Js .Undefined .return (4 ))-> not_ -> toBeUndefined )
87
89
test ("not toContainProperties" , () =>
88
- expect ({"foo" : 0 , "bar" : true }) -> not_ -> toContainProperties (["foo" , "zoo" ])
90
+ expect ({"foo" : 0 , "bar" : true })-> not_ -> toContainProperties (["foo" , "zoo" ])
89
91
)
90
92
test ("not toMatchObject" , () =>
91
- expect ({"a" : 1 , "b" : 2 , "c" : 3 }) -> not_ -> toMatchObject ({"a" : 1 , "c" : 2 })
93
+ expect ({"a" : 1 , "b" : 2 , "c" : 3 })-> not_ -> toMatchObject ({"a" : 1 , "c" : 2 })
92
94
)
93
95
})
94
96
}
0 commit comments