Skip to content

Commit

Permalink
added support for toContainEqual matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Suzdalnitski committed Oct 8, 2020
1 parent 05c9894 commit 7b8a5ca
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 115 deletions.
8 changes: 7 additions & 1 deletion __tests__/expect_test.ml
@@ -1,5 +1,9 @@
open Jest

type test_record = {
value: string
}

let () =

describe "Expect" (fun () ->
Expand All @@ -23,6 +27,8 @@ describe "Expect" (fun () ->
expect [| "a"; "b"; "c" |] |> toBeSupersetOf [| "a"; "c" |]);
test "toContain" (fun () ->
expect [| "a"; "b"; "c" |] |> toContain "b");
test "toContainEqual" (fun () ->
expect [| {value = "a"}; {value = "b"}; {value = "c"} |] |> toContainEqual {value = "b"});
test "toContainString" (fun () ->
expect "banana" |> toContainString "nana");
test "toHaveLength" (fun () ->
Expand Down Expand Up @@ -146,4 +152,4 @@ describe "ExpectJs" (fun () ->
expect [%obj { foo = 0; bar = true }] |> not_ |> toContainProperties [| "foo"; "zoo" |]);
test "not toMatchObject" (fun () ->
expect [%obj { a = 1; b = 2; c = 3 }] |> not_ |> toMatchObject [%obj { a = 1; c = 2 }]);
);
);

0 comments on commit 7b8a5ca

Please sign in to comment.