scala-cli
scala-cli copied to clipboard
Cookbook describing defining tests using scalatest
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
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?
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.
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:
and it's also how we handle Scala 2 vs Scala 3 on scala-lang.org and docs.scala-lang.org:
@ganeshchand says Docusaurus has a tabs thing...?
Sure, this can be achieved in Docusaurus using the tabs feature.