expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!

APACHE-2.0 License

Stars
651
Committers
66

Bot releases are hidden (Show)

expecto - v5.0.1 – Just improvements throughout

Published by haf about 7 years ago

  • Include assembly version info in the .Net core build thanks @aggieben
  • Task, Task<T> extensions for C#, thanks @0x53A
  • Bugfix for Expect.throws thanks @alex-bogomaz
  • isOK and isError, thanks @rmunn
  • allExists and allEqual thanks @MNie
  • Output/printer improvements, thanks @jindraivanek
  • DOcs thanks @AnthonyLloyd
  • Updated Expecto template thanks @MNie
expecto - v5.0.0 – The Spirit Guardian

Published by haf over 7 years ago

In this release we have done some major-version improvements, like adding support for .Net Core out of the box, added Assert functions and improved output for continuous integration systems.

  • New Assert.isOk and isError for the new F# result types. (thanks @rmunn)
  • New allEqual assert function (thanks @MNie)
  • Bump to latest and greatest Logary facade (@haf)
  • Greatly improve documentation (see README) for FsCheck (thanks @anthonylloyd)
  • Bugfixes
    • New CI matrix build added
    • .Net Framework version target is now v4.6.1
    • Support for latest Mono.Cecil
expecto - v5.0.0-rc1 – TeamCity improvements

Published by haf over 7 years ago

Helping the TeamCity runner along by replacing spaces with underscores and slashes with dots. Thanks @ronniebarker

That's it. Have fun!

expecto - v5.0-beta.3 – Fixing delayed async logging

Published by haf over 7 years ago

Thanks to @enricosada @cloudRoutine and @forki for help with getting this release out. This release contains primarily bugfixes and pretty-printing changes:

I've changed the colourisation of verbose output and together with @adamchester made the path to the logger be printed. Or in a picture:

This aims to make it easier to see relevant log messages; less clutter.

This means that you can write a test like:

open Expecto
open Expecto.Logging
open Expecto.Logging.Message

let logger = Log.create "MyApp.Tests"
let [<Tests>] test =
  testCase "foo bar test" <| fun () ->
    let res = app "input string"
    logger.debug (eventX "Got {response} from app" >> setField "response")
    Expect.equal res "mar foo" "Should return a sensible output"

And have that display nicely in the log when you run mytests.exe --debug (which enables debug logging)

Also note that you can configure the logger with your own colour palette; have a look at the Logary facade for F# for notes on how.

Helping out

If you want to get involved, here are a few open issues that could be nice to start with:

They are of varying complexity. We could also use some better docs on how to run stress tests with FsCheck, see https://github.com/haf/expecto/issues/141 for a detailed investigation that would be useful to document.

Another documentation opportunity is to use https://github.com/haf/expecto/issues/136#issue-220219860 as an example of how to write FsCheck tests with Expecto.

expecto - v4.2.0 – target F# v4.1

Published by haf over 7 years ago

expecto - v4.2.1 – Fixing delayed async logging

Published by haf over 7 years ago

expecto - v5.0.0-beta2 – More .Net Core

Published by haf over 7 years ago

expecto - v5.0.0-beta1 – .Net Core support

Published by haf over 7 years ago

This release marks the start of .Net Core support in Expecto. A big thanks to @cloudRoutine for starting the port, and to @adamchester for going that extra mile and finishing it off!

Also since last release, here's a Roman's photo of Expecto being used for testing hardware chips.

Hardware testing

Here's the nuget.org version – enjoy!

expecto - v4.1.1 – Expect.isMatch, .Net 4.6.1, bump BenchmarkDotNet

Published by haf over 7 years ago

This release makes it easier to reference BenchmarkDotnet and to write expectations of matching regexes:

Expect.isMatch "{function:45}" "{function:(\\d+)}" "string matches passed pattern"
Expect.isNotMatch "{function:45d}" "{function:(\\d+)}" "string not matches passed pattern"
let regex = Regex("{function:(\\d+)}")
Expect.isRegexMatch "{function:45}" regex "string matches passed regex"
let regex = Regex("{function:(\\d+)}")
Expect.isRegexMatch "{function:45d}" regex "Deliberately failing"

I've also fixed the names of the nuget, from this:

to this:

expecto - v4.1.0 – a gaggle of improvements

Published by haf over 7 years ago

A nice new minor release with the fixues from many different people.

  • de07dcd – Thanks for documentation improvements @forki
  • e9d4c7a – Thanks for documentation improvements @Krzysztof-Cieslak
  • Thanks to @MecuSorin for his tests for the test attributes
  • Thanks to @MNie for adding assertion functions on the Expect module
  • Thanks to @AnthonyLloyd for your asyncTest workflow builder and updating docs
  • Thanks to @smoothdeveloper for going through the naming of our variables
  • Thanks to @smoothdeveloper for creating a fluent API in Expecto.Flip!
  • Thanks to @baronfel for creating a new C# API in namespace Expecto.CSharp
  • We've upgraded the F# Core library requirement to v4.x+
  • Thanks to @AnthonyLloyd for fixing a Travis issue in 9a04ec6
  • I've personally done improvements on IRunner in FsCheck: it can now be configured with callbacks which you can use for logging, like so:
open Expecto
open Expecto.Logging
open Expecto.Logging.Message

let logger = Log.create "Sample"

let printingFsCheck =
  { FsCheckConfig.defaultConfig with
      receivedArgs = fun config name no args ->
        logger.debugWithBP (
          eventX "For {test} {no}, generated {args}"
          >> setField "test" name
          >> setField "no" no
          >> setField "args" args)
      maxTest = 10000
  }

let test =
  testPropertyWithConfig printingFsCheck "addition is commutative" <| fun a b ->
    a + b = b + a
expecto - v4.0.3 – FsCheck bump, correcting docs

Published by haf over 7 years ago

Fix #105, #104, #103

expecto - v4.0.1 – Bugfix --filter cmd line flag

Published by haf over 7 years ago

Filtering tests is now unit-tested and working.

Testing,
Let's me do my resting,
Outside of work,
Because I know the code won't bork.

expecto - v4.0.0 – Grouped async and stress tests

Published by haf over 7 years ago

Thanks to the great work of @AnthonyLloyd we now support stress tests and grouped async/parallel tests in expecto!

You write your tests like normal, and if you want to enable stress testing, just pass the corresponding flag to your executable.

Use testSequencedGroup to group sequential tests. This means that things which are not sequenced to the group will run in parallel to the group. Docs

More docs in the README.

expecto - v3.2.1 – Expect messages improvements

Published by haf over 7 years ago

Minor improvements to the Expect assertion messages. Thanks to @isaacabraham for his contribution.

expecto - v3.2.0 – Logo, parallel-args bug fix, FsCheck printer, docs

Published by haf almost 8 years ago

expecto-logo-large

In this release we have a new logo! Rejoice and thanks to @sergey-tihon for his awesome work! This library now also has a nice twitter account @ExpectoIO.

v3.2.0 is a minor bump in version because we have a new feature – support for ptestProperty to make test properties pending, support for passing the standard gen-seed to FsCheck and a brand new FsCheck printer that nicely formats the output from FsCheck as it runs. Many thanks go out to @AnthonyLloyd for adding these improvements.

Version 3.0+ introduced a bug when you turn off parallelism with { config with parallel = false }, causing some test suites to hang and others to crash. This release fixes that bug (#83).

We'd also like some feedback with regards to our plans for supporting stress testing, so if you are on github, do check it out and perhaps give your opinion.

Happy testing!
Henrik

expecto - v3.1.0 – TeamCity printers

Published by haf almost 8 years ago

Expecto now supports TeamCity out of the box. If the test framework is running inside a TeamCity instance, it will notice it and print accordingly.

Thanks to @theimowski for contributing this!

expecto - v3.0.2 – Downgrade BenchmarkDotNet

Published by haf almost 8 years ago

Fixes #74

expecto - v3.0.1 – bugfix release for FileNotFoundException w/ Cecil

Published by haf almost 8 years ago

expecto - v3.0.0 – Ionide highlighting infra, `testCaseAsync`

Published by haf almost 8 years ago

The v3 release comes with new bells and whistles – it now supports async tests and has out-of-the box integration with Ionide's test location support. When you write a test in Ionide you can now use Expecto out of the box to run them and run them on code changes! After running them you'll get highlights in the editor to show which failed and which passed. Thanks to @Krzysztof-Cieslak for his contributions!

https://video.twimg.com/tweet_video/C1lBWlYWEAATB53.mp4

Asserting on floats with floatClose

There's also a new Expect.floatClose assertion function that's more robust than floatEquals. We've updated the docs for you, and there's this pull request with the background. Thanks @AnthonyLloyd for your contributions!

Async test support

@AnthonyLloyd Has also contributed a new asynchronous test runner to fix issue #2. You can create async tests with testCaseAsync "name" async {} and they'll be run like they should.

Remember testSequenced

When you run performance tests or use Expect.fasterThan, remember to use the newly added testSequenced function that can tag Test-values (testList, testCase, testCaseAsync) to make your tests robust to run in parallel.

Happy testing!
Henrik

expecto - v2.4.1 – Support failing tests if there are focused tests

Published by haf almost 8 years ago

  • This release provides a runTestsWithArgs function which runs the passed tests and also overrides the passed ExpectoConfig with the command line parameters.
  • Expecto now accepts the command line argument --fail-on-focused-tests, which checks if focused tests exist. This parameter can be set in build scripts and allows CI servers to reject commits that accidentally included focused tests.

If someone has focused a test but not unfocused it before committing, you can now have the CI server go red! ;)