Skip to content

Commit a256c85

Browse files
committed
style: formatting
1 parent 2c6c0d6 commit a256c85

File tree

8 files changed

+814
-632
lines changed

8 files changed

+814
-632
lines changed

__tests__/expect_test.res

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,52 @@ let () = {
66
describe("Expect", () => {
77
open Expect
88

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"})
1920
)
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)
2627

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"))
3031
test("toThrowErrorMatchingSnapshot", () =>
31-
expect(() => Js.Exn.raiseError("foo error")) -> toThrowErrorMatchingSnapshot
32+
expect(() => Js.Exn.raiseError("foo error"))->toThrowErrorMatchingSnapshot
3233
)
3334

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"})
4446
)
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)
5153

52-
test("expectFn", () => expectFn(raise, Invalid_argument("foo")) -> toThrow)
54+
test("expectFn", () => expectFn(raise, Invalid_argument("foo"))->toThrow)
5355
})
5456

5557
describe("Expect.Operators", () => {
@@ -69,26 +71,26 @@ let () = {
6971
describe("ExpectJs", () => {
7072
open ExpectJs
7173

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)
7779
test("toContainProperties", () =>
78-
expect({"foo": 0, "bar": true}) -> toContainProperties(["foo", "bar"])
80+
expect({"foo": 0, "bar": true})->toContainProperties(["foo", "bar"])
7981
)
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}))
8183

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)
8789
test("not toContainProperties", () =>
88-
expect({"foo": 0, "bar": true}) -> not_ -> toContainProperties(["foo", "zoo"])
90+
expect({"foo": 0, "bar": true})->not_->toContainProperties(["foo", "zoo"])
8991
)
9092
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})
9294
)
9395
})
9496
}

__tests__/globals_only_test.res

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,27 @@ let () = {
2828
fail("")
2929
}
3030
)
31-
Only.testAllPromise("testAllPromise", list{"foo", "bar", "baz"}, input => Promise.resolve(
32-
if Js.String.length(input) === 3 {
33-
pass
34-
} else {
35-
fail("")
36-
}
37-
))
38-
Only.testAllPromise("testAllPromise - tuples", list{("foo", 3), ("barbaz", 6), ("bananas!", 8)}, ((input, output)) => Promise.resolve(
39-
if Js.String.length(input) === output {
40-
pass
41-
} else {
42-
fail("")
43-
}
44-
))
31+
Only.testAllPromise("testAllPromise", list{"foo", "bar", "baz"}, input =>
32+
Promise.resolve(
33+
if Js.String.length(input) === 3 {
34+
pass
35+
} else {
36+
fail("")
37+
},
38+
)
39+
)
40+
Only.testAllPromise(
41+
"testAllPromise - tuples",
42+
list{("foo", 3), ("barbaz", 6), ("bananas!", 8)},
43+
((input, output)) =>
44+
Promise.resolve(
45+
if Js.String.length(input) === output {
46+
pass
47+
} else {
48+
fail("")
49+
},
50+
),
51+
)
4552

4653
Only.describe("Only.describe", () => test("some aspect", () => pass))
4754
}

0 commit comments

Comments
 (0)