FsUnit.Expecto
See original GitHub issueI think that would be nice to have an alternative assertion syntax for Expecto as well. A lot of people, including myself, like use the FsUnit
DSL for assertions.
Awesome, @kleidemos did most of the work to make it happened. https://gist.github.com/kleidemos/35af85db392f21eaedc095b50c3c9449 The only missing piece is to decide how to merge it into FsUnit
.
I see three option, ordered by my current preference.
Option 1 (FsUnitTyped-like syntax, no NuGet package)
Pros:
- Type-safe assertions
- Backward compatibility with tests written using
FsUnitTyped
- http://fsprojects.github.io/FsUnit/FsUnitTyped.html#What-is-FsUnitTyped
Cons:
- Limited support for Expecto
Expect
module - No
message
parameter in operator - No NuGet package
Option 2 (FsUnit-like syntax, release on NuGet)
Pros:
- Backward compatibility tests with written using
FsUnit
- http://fsprojects.github.io/FsUnit/operators.html - NuGet package
Cons:
- Limited support for Expecto
Expect
module - No
message
parameter in operator - Not type-safe
Option 3 (new syntax adapted for Expecto)
Pros:
- Better support of Expecto capabilities
message
parameter in operator- NuGet package
Cons:
- No compatibility with existing
FsUnit
implementations
What is the right way to go?
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Expecto
The Expecto library can be installed from NuGet: PM> Install-Package Expecto. Expecto.Flip has a similar syntax to FsUnit . Expecto is not part...
Read more >What is FsUnit?
FsUnit is a set of libraries that makes unit-testing with F# more enjoyable. It adds a special syntax to your favorite .NET testing...
Read more >Review: F# unit testing frameworks and libraries
Expecto is a F# testing framework that does a lot. It has an API for running tests, test adapters for runners, assertions, performance...
Read more >How to properly test Exceptions with FsUnit
Answer has been found. To test that exception was thrown I should wrap my function call in the next style:
Read more >Das.Test - an opinionated unit testing library written in F# ...
A couple of days ago I was trying to setup unit tests for my pet project using this link from MS but couldn't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Doesn’t Expecto already have something similar to
Option 1
, which can be enabled by addingopen Expecto.Flip
in your test file. (https://github.com/haf/expecto/blob/master/Expecto/Flip.Expect.fs). I have never used theFsUnitTyped syntax
before, onlyFsUnit syntax
. To differentiateFsUnit.Expecto
fromExpecto.Flip
, maybe Option 2 or 3 would be best?Ok, I think that these are not enough reasons to compete with
Flip.Expect