question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I 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:

Cons:

  • Limited support for Expecto Expect module
  • No message parameter in operator
  • No NuGet package

Option 2 (FsUnit-like syntax, release on NuGet)

Pros:

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:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
atlemanncommented, Apr 3, 2018

Doesn’t Expecto already have something similar to Option 1, which can be enabled by adding open Expecto.Flip in your test file. (https://github.com/haf/expecto/blob/master/Expecto/Flip.Expect.fs). I have never used the FsUnitTyped syntax before, only FsUnit syntax. To differentiate FsUnit.Expecto from Expecto.Flip, maybe Option 2 or 3 would be best?

0reactions
sergey-tihoncommented, Oct 2, 2019

Ok, I think that these are not enough reasons to compete with Flip.Expect

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found