Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DZakh committed Sep 8, 2024
1 parent 09d926a commit 35655bd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/tests/src/utils/U.res
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ external magic: 'a => 'b = "%identity"
external castAnyToUnknown: 'any => unknown = "%identity"
external castUnknownToAny: unknown => 'any = "%identity"

%private(
@val @scope("JSON")
external unsafeStringify: 'a => string = "stringify"
)

let unsafeGetVariantPayload = variant => (variant->Obj.magic)["_0"]

exception Test
Expand All @@ -31,11 +36,7 @@ let assertThrowsTestException = {

let assertErrorResult = (t, result, errorPayload) => {
switch result {
| Ok(any) =>
t->Assert.fail(
"Asserted result is not Error. Recieved: " ++
any->Js.Json.stringifyAny->Belt.Option.getUnsafe,
)
| Ok(any) => t->Assert.fail("Asserted result is not Error. Recieved: " ++ any->unsafeStringify)
| Error(err) => t->Assert.is(err->S.Error.message, error(errorPayload)->S.Error.message, ())
}
}
Expand Down

0 comments on commit 35655bd

Please sign in to comment.