elm-explorations / elm-explorations/test

Expect.equalUnder fn

Open
#231 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Elm
Stars
244
Forks
40
Avg merge
1d 23h
Merged PRs (30d)
2

Description

Apply a function to both `actual` and `expected` before comparing them:

```elm
expectEqualUnder : (a -> b) -> a -> a -> Expectation
expectEqualUnder f a2 a1 =
f a1
|> Expect.equal (f a2)
```

Example of usage:
```elm
str
|> thereAndBack
|> expectEqualUnder String.trim str
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.