Scala Test-State alternatives and similar packages
Based on the "Testing" category.
Alternatively, view Scala Test-State alternatives based on common mentions on social networks and blogs.
Gatling9.8 9.7 Scala Test-State VS GatlingModern Load Testing as Code
FS29.3 9.6 Scala Test-State VS FS2Compositional, streaming I/O library for Scala
ScalaCheck9.1 7.3 Scala Test-State VS ScalaCheckProperty-based testing for Scala
ScalaTest8.6 6.7 Scala Test-State VS ScalaTestA testing tool for Scala and Java developers
dotenv-linter⚡️Lightning-fast linter for .env files. Written in Rust 🦀
Diffy7.9 1.0 Scala Test-State VS DiffyFind potential bugs in your services with Diffy
Specs27.8 7.4 Scala Test-State VS Specs2Software Specifications for Scala
ScalaMock6.5 5.8 Scala Test-State VS ScalaMockNative Scala mocking framework
ScalaMeter6.5 0.0 Scala Test-State VS ScalaMeterMicrobenchmarking and performance regression testing framework for the JVM platform.
µTest6.4 6.2 Scala Test-State VS µTestA simple testing framework for Scala
MUnit6.0 8.9 Scala Test-State VS MUnitScala testing library with actionable errors and extensible APIs
Mockito ScalaMockito for Scala language
scalaprops5.1 7.0 Scala Test-State VS scalapropsproperty based testing library for Scala
cornichon4.9 9.5 Scala Test-State VS cornichonScala DSL for testing HTTP JSON API
Scalive4.6 0.0 L4 Scala Test-State VS ScaliveConnect a Scala REPL to running JVM processes without any prior setup
Minitest4.5 0.0 Scala Test-State VS MinitestThe super light testing library for Scala and Scala.js
Stryker4s4.4 8.6 Scala Test-State VS Stryker4sMutation testing for Scala
Nyaya4.2 0.0 Scala Test-State VS NyayaRandom Data Generation and/or Property Testing in Scala & Scala.JS.
LambdaTest3.8 0.6 Scala Test-State VS LambdaTestFunctional testing for Scala.
Testcontainers-scalaThe project repository has moved to https://github.com/testcontainers/testcontainers-scala
databob0.9 0.0 Scala Test-State VS databobRandomised, zero-boilerplate object builders
Static code analysis for 29 languages.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Scala Test-State or a related project?
Test stateful stuff statelessly, and reasonably.
- What is this?
- How does this work?
- How do I use this?
What is this?
Firstly, a quick mention of what this is not:
This is not a test framework. Use it conjunction with ScalaTest, Specs2, μTest, etc.
This is not a property testing library. Use it conjunction with ScalaCheck, Nyaya, ScalaProps, etc.
Ok, so what is this? This is a library that:
Lets you write pure, immutable, referentially-transparent tests that verify stateful, effectful code or data.
Encourages composability of test concepts such as invariants/properties, pre/post conditions, dynamic actions/assertions, and more.
Makes test failure and inspection easy to comprehend.
- Unit-test a webapp with Scala.JS.
- Integration testing.
- UAT automation.
- Random-test (fuzz-test) like Android's
- Data migration.
- Compiled for Scala & Scala.JS.
- Can run synchronously, asynchronously (
Future) or in your own context-type (eg
IO). Is stack-safe.
- Everything is immutable and composable.
- Everything can be transformed into (reused in) different contexts.
- Combines property and imperative testing.
- Actions and assertions can be non-deterministic and/or dependent on runtime state.
- Transparent and informative about test execution.
- Includes an abstract
DomZipperwhich greatly simplifies the task of HTML/SVG observation.
- Comes with various
DomZipperimplementations and backends.
- Lots of platform-specific utilities for web testing.
- Configurable error handling. Be impure and throw exceptions or be pure and use a custom ADT to precisely maintain all forms of failure and error in your domain; it's up to you.
- Extension modules for various 3rd-party libraries. (Scalaz, Cats, more.)
How does this work?
The key is to take observations of anything relevant in the stateful test subject. Observations are like immutable snapshots. They capture what the state was at a particular point in time. Once an observation is captured, assertions are performed on it.
Optionally, you can specify some kind of test-only state that you modify as you test, and use to ensure the real-world observations are what you expect. For example, if you're testing a bank account app, you could maintain your own expected balance such that when you instruct the app to make a deposit, you add the same amount to your state. You could then add an invariant that whenever the balance is shown in the app, it matches the expected state balance.
This is a (simplified) model of how tests are executed:
When retries are enabled, then test execution is like this.
How do I use this?
||The core module.||JVM||JS|
||Standalone utility for observing web DOM with precision with conciseness.This is the base API; concrete implementations below.||JVM||JS|
||DOM zipper built on Jsoup.||JVM|
||DOM zipper built on Selenium.Also comes with a fast version with uses Jsoup for nearly all operations which is 5-50x faster.See [doc/SELENIUM.md](doc/SELENIUM.md).||JVM|
||DOM zipper built on Sizzle.||JS|
||Extensions for Cats.||JVM||JS|
||Extensions for Nyaya.||JVM||JS|
||Extensions for scalajs-react.||JS|
||Extensions for Scalaz.||JVM||JS|
||Extensions for Selenium.||JVM|
- [Scala.Js + React](example-react) - Demonstrates DomZipper, invariants, actions, basics.
- [Selenium](example-selenium) - Demonstrates Selenium testing of external web content, using retry scheduling (instead of
Thread.sleep), parallelism and concurrency.
- [TODO] DB triggers. - real external state, ref.
- [TODO] Mutable sample. - fuzz, invariants.
If you like what I do —my OSS libraries, my contributions to other OSS libs, my programming blog— and you'd like to support me, more content, more lib maintenance, please become a patron! I do all my OSS work unpaid so showing your support will make a big difference.