scala-cli icon indicating copy to clipboard operation
scala-cli copied to clipboard

Cookbook describing defining tests using scalatest

Open romanowski opened this issue 3 years ago • 1 comments

A short cookbook that will show how to define tests using ScalaTest. I should cover 2 different test files and test utils.

An example test using Munit

romanowski avatar Nov 02 '21 12:11 romanowski

What this cookbook should be about? Where should it be put? Should it be with ScalaTest or MUnit? Should it be added to MUnit documentation?

zmerr avatar Feb 15 '22 15:02 zmerr

Where should it be put?

under "Introductory cookbooks", I guess

Should it be with ScalaTest or MUnit?

I'd suggest doing both. Copy-and-paste ftw.

Should it be added to MUnit documentation?

I expect they'd be happy to link to it from their doc.

SethTisue avatar Jun 10 '23 03:06 SethTisue

re: multiple testing frameworks, I notice that the way it was handled at https://scala-cli.virtuslab.org/docs/cookbooks/test-only was to have separate sections for each framework.

I think that's unsatisfactory — it makes the page pretty hard to read. Any particular reader is only going to care about one framework at a time.

So I would suggest the copy-and-paste approach, so that part of the cookbooks list would look like:

  • Filter the test suites to run (with ScalaTest)
  • Filter the test suites to run (with MUnit)
  • ...

But I'll mention another possibility, which is to use tabs within the cookbook. That's how we handled multiple build tools in the tutorials for the Scala Toolkit: Screenshot 2023-06-09 at 8 22 47 PM

and it's also how we handle Scala 2 vs Scala 3 on scala-lang.org and docs.scala-lang.org: Screenshot 2023-06-09 at 8 23 39 PM

SethTisue avatar Jun 10 '23 03:06 SethTisue

@ganeshchand says Docusaurus has a tabs thing...?

SethTisue avatar Jun 10 '23 03:06 SethTisue

Sure, this can be achieved in Docusaurus using the tabs feature.

lwronski avatar Jun 11 '23 16:06 lwronski