ScalaTest is a free, open-source testing toolkit for Scala and Java programmers

Related tags

Testing scalatest
Overview

ScalaTest

Build Status

ScalaTest is a free, open-source testing toolkit for Scala and Java programmers.

Official Website: http://www.scalatest.org/

Using ScalaTest

Setup

Please visit Download and Setup for download and setup instructions.

Quick Start

Please visit Quick Start for steps to get started quickly.

Building ScalaTest

Pre-Requisites

The followings are needed for building ScalaTest:

use the following SBT options instead:

SBT_OPTS="-Xms512M -Xmx3000M -Xss1M -XX:NewRatio=8"

Building and Running Tests

This command will build and run the regular tests:

$ sbt test

To include flicker tests, you'll need to set environment variable SCALATEST_RUN_FLICKER_TESTS=true:

> export SCALATEST_RUN_FLICKER_TESTS=true
> sbt test

To run generated all tests, you'll need to increase maximum heap size to at least -Xmx5000M, and use this command instead:

$ rm -rf gentests
$ sbt gentests/test

You can also run different groups generated tests separately:

$ rm -rf gentests
$ sbt genMustMatchersTests1/test
$ sbt genMustMatchersTests2/test
$ sbt genMustMatchersTests3/test
$ sbt genMustMatchersTests4/test
$ sbt genGenTests/test
$ sbt genTablesTests/test
$ sbt genInspectorsTests/test
$ sbt genInspectorsShorthandsTests1/test
$ sbt genInspectorsShorthandsTests2/test
$ sbt genTheyTests/test
$ sbt genContainTests1/test
$ sbt genContainTests2/test
$ sbt genSortedTests/test
$ sbt genLoneElementTests/test
$ sbt genEmptyTests/test

What it does is simply switch to gentests project and run test.

To run scala-js tests:

$ sbt scalatestAppJS/clean
$ sbt scalacticTestJS/test:compile
$ sbt scalacticTestJS/test
$ sbt scalatestTestJS/test:compile
$ sbt scalatestTestJS/test

To run scala-native tests:

$ sbt -Dscalatest.skip.jdk.check=true ++2.11.12 scalatestAppNative/clean
$ sbt -Dscalatest.skip.jdk.check=true ++2.11.12 scalacticTestNative/test:compile
$ sbt -Dscalatest.skip.jdk.check=true ++2.11.12 scalacticTestNative/test
$ sbt -Dscalatest.skip.jdk.check=true ++2.11.12 scalatestTestNative/test:compile
$ sbt -Dscalatest.skip.jdk.check=true ++2.11.12 scalatestTestNative/test

Building Examples

You can build examples project using this command:

$ sbt examples/compile

Packaging

You can package the ScalaTest JAR file using this command:

$ sbt package

The resulting JAR file will be produced in target/scala-2.11/.

You can also publish it to your local Ivy repository using this command:

$ sbt publishLocal

Or publish it to local maven repository using this command:

$ sbt publishM2

Publishing

To publish to Sonatype, you first need to make sure you have the following:

  • A GPG client is installed on your command line path. For more information, please refer to GNU Privacy Guard Website.
  • You have created your GPG keys and distributed your public key to hkp://pool.sks-keyservers.net/. For more information, please refer to How To Generate PGP Signatures With Maven.
  • You have been granted the right to publish using org.scalatest and org.scalactic domain.

By default, ScalaTest build will read your Sonatype credentials from ~/.ivy2/.credentials, which is a properties file that looks like this:

realm=Sonatype Nexus Repository Manager
host=oss.sonatype.org
user=xxxxxxxx
password=xxxxxxxx

You can use SCALATEST_NEXUS_LOGIN and SCALATEST_NEXUS_PASSWORD environment variables to override Sonatype credentials.

For signing, ScalaTest build will use ~/.gnupg/secring.gpg by default and prompt for GPG passphase if required. Alternatively you can use SCALATEST_GPG_FILE to use a different GPG file, and use SCALATEST_GPG_PASSPHASE to provide GPG passphase to avoid input prompt.

If you would like to export a particular private key into a separate GPG file, you can use the following command:

$ gpg --export-secret-keys [email protected] > example-secret-key.gpg

With Sonatype credentials and GPG file in place, you can now publish to Sonatype.

Before publishing any patch release, binary compatibility with previous version should be checked:

$ export SCALAJS_VERSION=0.6.33
$ sbt ++2.10.7 scalactic/package scalactic/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestCore/package scalatestCore/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFeatureSpec/package scalatestFeatureSpec/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFlatSpec/package scalatestFlatSpec/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFreeSpec/package scalatestFreeSpec/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFunSuite/package scalatestFunSuite/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFunSpec/package scalatestFunSpec/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestPropSpec/package scalatestPropSpec/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestRefSpec/package scalatestRefSpec/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestWordSpec/package scalatestWordSpec/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestDiagrams/package scalatestDiagrams/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestMatchersCore/package scalatestMatchersCore/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestShouldMatchers/package scalatestShouldMatchers/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestMustMatchers/package scalatestMustMatchers/mimaReportBinaryIssues
$ sbt ++2.10.7 scalacticJS/package scalacticJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestCoreJS/package scalatestCoreJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFeatureSpecJS/package scalatestFeatureSpecJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFlatSpecJS/package scalatestFlatSpecJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFreeSpecJS/package scalatestFreeSpecJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFunSuiteJS/package scalatestFunSuiteJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestFunSpecJS/package scalatestFunSpecJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestPropSpecJS/package scalatestPropSpecJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestWordSpecJS/package scalatestWordSpecJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestDiagramsJS/package scalatestDiagramsJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestMatchersCoreJS/package scalatestMatchersCoreJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestShouldMatchersJS/package scalatestShouldMatchersJS/mimaReportBinaryIssues
$ sbt ++2.10.7 scalatestMustMatchersJS/package scalatestMustMatchersJS/mimaReportBinaryIssues

$ export SCALAJS_VERSION=1.7.1
$ sbt ++2.11.12 scalactic/package scalactic/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestCore/package scalatestCore/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFeatureSpec/package scalatestFeatureSpec/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFlatSpec/package scalatestFlatSpec/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFreeSpec/package scalatestFreeSpec/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFunSuite/package scalatestFunSuite/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFunSpec/package scalatestFunSpec/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestPropSpec/package scalatestPropSpec/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestRefSpec/package scalatestRefSpec/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestWordSpec/package scalatestWordSpec/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestDiagrams/package scalatestDiagrams/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestMatchersCore/package scalatestMatchersCore/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestShouldMatchers/package scalatestShouldMatchers/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestMustMatchers/package scalatestMustMatchers/mimaReportBinaryIssues
$ sbt ++2.11.12 scalacticJS/package scalacticJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestCoreJS/package scalatestCoreJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFeatureSpecJS/package scalatestFeatureSpecJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFlatSpecJS/package scalatestFlatSpecJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFreeSpecJS/package scalatestFreeSpecJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFunSuiteJS/package scalatestFunSuiteJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestFunSpecJS/package scalatestFunSpecJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestPropSpecJS/package scalatestPropSpecJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestWordSpecJS/package scalatestWordSpecJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestDiagramsJS/package scalatestDiagramsJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestMatchersCoreJS/package scalatestMatchersCoreJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestShouldMatchersJS/package scalatestShouldMatchersJS/mimaReportBinaryIssues
$ sbt ++2.11.12 scalatestMustMatchersJS/package scalatestMustMatchersJS/mimaReportBinaryIssues

$ sbt ++2.12.15 scalactic/package scalactic/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestCore/package scalatestCore/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFeatureSpec/package scalatestFeatureSpec/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFlatSpec/package scalatestFlatSpec/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFreeSpec/package scalatestFreeSpec/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFunSuite/package scalatestFunSuite/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFunSpec/package scalatestFunSpec/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestPropSpec/package scalatestPropSpec/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestRefSpec/package scalatestRefSpec/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestWordSpec/package scalatestWordSpec/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestDiagrams/package scalatestDiagrams/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestMatchersCore/package scalatestMatchersCore/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestShouldMatchers/package scalatestShouldMatchers/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestMustMatchers/package scalatestMustMatchers/mimaReportBinaryIssues
$ sbt ++2.12.15 scalacticJS/package scalacticJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestCoreJS/package scalatestCoreJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFeatureSpecJS/package scalatestFeatureSpecJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFlatSpecJS/package scalatestFlatSpecJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFreeSpecJS/package scalatestFreeSpecJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFunSuiteJS/package scalatestFunSuiteJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestFunSpecJS/package scalatestFunSpecJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestPropSpecJS/package scalatestPropSpecJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestWordSpecJS/package scalatestWordSpecJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestDiagramsJS/package scalatestDiagramsJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestMatchersCoreJS/package scalatestMatchersCoreJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestShouldMatchersJS/package scalatestShouldMatchersJS/mimaReportBinaryIssues
$ sbt ++2.12.15 scalatestMustMatchersJS/package scalatestMustMatchersJS/mimaReportBinaryIssues

$ sbt ++2.13.6 scalactic/package scalactic/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestCore/package scalatestCore/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFeatureSpec/package scalatestFeatureSpec/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFlatSpec/package scalatestFlatSpec/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFreeSpec/package scalatestFreeSpec/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFunSuite/package scalatestFunSuite/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFunSpec/package scalatestFunSpec/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestPropSpec/package scalatestPropSpec/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestRefSpec/package scalatestRefSpec/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestWordSpec/package scalatestWordSpec/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestDiagrams/package scalatestDiagrams/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestMatchersCore/package scalatestMatchersCore/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestShouldMatchers/package scalatestShouldMatchers/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestMustMatchers/package scalatestMustMatchers/mimaReportBinaryIssues
$ sbt ++2.13.6 scalacticJS/package scalacticJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestCoreJS/package scalatestCoreJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFeatureSpecJS/package scalatestFeatureSpecJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFlatSpecJS/package scalatestFlatSpecJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFreeSpecJS/package scalatestFreeSpecJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFunSuiteJS/package scalatestFunSuiteJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestFunSpecJS/package scalatestFunSpecJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestPropSpecJS/package scalatestPropSpecJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestWordSpecJS/package scalatestWordSpecJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestDiagramsJS/package scalatestDiagramsJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestMatchersCoreJS/package scalatestMatchersCoreJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestShouldMatchersJS/package scalatestShouldMatchersJS/mimaReportBinaryIssues
$ sbt ++2.13.6 scalatestMustMatchersJS/package scalatestMustMatchersJS/mimaReportBinaryIssues

To publish scalatest modules for jvm, js, native and dotty, use the following commands:

$ ./publish.sh
Comments
  • Modify Prettifier.truncateAt to work on case classes

    Modify Prettifier.truncateAt to work on case classes

    In the PR https://github.com/scalatest/scalatest/pull/2131, Prettifier.truncateAt was added which allows the truncating of massive collections when they are pretty printed by ScalaTest. Unfortunately the current Prettifier.truncateAt doesn't work if collection/s are wrapped inside a case class (in my case the data I generate is located within case classes).

    Due to Scala having Product along with methods for iterating over fields in a case class, the implementation is quite straight forward (just apply prettify on every element in the productIterator).

    Note that we DO NOT truncate the number of fields within the case class, only the values behind those fields.

    cla-signed 
    opened by mdedetrich 33
  • report absolute file and line number of failing test

    report absolute file and line number of failing test

    Many text editors can perform automatic "jump to error" and so on if the absolute file and line number is included in a warn/error message.

    It would be incredibly useful for emacs/Vim/sublime/atom integration if failing scalatests were reported with full path and line number (emacs even supports column number).

    The failing line in the test need not be automatically discovered (unrolling the stacktrace can be a pretty tough job), it is enough to have the line that begins the test.

    For example, today if my test fails I see this:

    [info] - should marshal DebugLocation *** FAILED ***
    [info]   SexpCons(SexpSymbol(:return),SexpCons(SexpCons(SexpSymbol(:ok),SexpCons(SexpCons(SexpSymbol(:type),SexpCons(SexpSymbol(reference),SexpCons(SexpSymbol(:object-id),SexpCons(SexpString(57),SexpNil)))),SexpNil)),SexpCons(SexpNumber(666),SexpNil))) was not equal to SexpCons(SexpSymbol(:type),SexpCons(SexpSymbol(reference),SexpCons(SexpSymbol(:object-id),SexpCons(SexpString(57),SexpNil)))) (SwankFormatsSpec.scala:20)
    [info]   org.scalatest.exceptions.TestFailedException:
    [info]   at org.scalatest.MatchersHelper$.newTestFailedException(MatchersHelper.scala:160)
    [info]   at org.scalatest.Matchers$AnyShouldWrapper.shouldBe(Matchers.scala:6408)
    ... big stack trace ...
    

    Note the failing line 20 in the error message is just some utility, not the actual test, and the filename is not absolute. We could potentially infer the filename using ENSIME, but that means this won't work without an ENSIME server.

    but if it was like this, then I'd be able to jump to that failing test easily:

    [info] - should marshal DebugLocation *** FAILED *** /path/to/my/file/SwankFormatsSpec.scala:100
    ...
    

    Then the filepath and line can be extracted with a pattern match.

    Some people might find it useful to have the filename/line on ignored tests as well.

    I've tried my best to get something working in https://github.com/hvesalai/sbt-mode/pull/29 but my changes only allow the user to jump the cursor to the failure message, it doesn't open up the failed test's source code.

    opened by fommil 31
  • No route to host exception while running tests

    No route to host exception while running tests

    > last service/test:testOnly
    [error] Uncaught exception when running tests: java.net.NoRouteToHostException: No route to host
    sbt.ForkMain$ForkError: No route to host
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
            at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
            at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
            at java.net.Socket.connect(Socket.java:579)
            at java.net.Socket.connect(Socket.java:528)
            at java.net.Socket.<init>(Socket.java:425)
            at java.net.Socket.<init>(Socket.java:208)
            at org.scalatest.tools.SocketReporter.<init>(SocketReporter.scala:26)
            at org.scalatest.tools.ReporterFactory.createSocketReporter(ReporterFactory.scala:221)
            at org.scalatest.tools.ReporterFactory.getReporterFromConfiguration(ReporterFactory.scala:236)
            at org.scalatest.tools.ReporterFactory$$anonfun$createReportersFromConfigurations$1.apply(ReporterFactory.scala:242)
            at org.scalatest.tools.ReporterFactory$$anonfun$createReportersFromConfigurations$1.apply(ReporterFactory.scala:241)
            at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
            at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
            at scala.collection.Iterator$class.foreach(Iterator.scala:727)
            at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
            at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
            at org.scalatest.tools.ReporterConfigurations.foreach(ReporterConfiguration.scala:43)
            at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
            at org.scalatest.tools.ReporterConfigurations.map(ReporterConfiguration.scala:43)
            at org.scalatest.tools.ReporterFactory.createReportersFromConfigurations(ReporterFactory.scala:241)
            at org.scalatest.tools.ReporterFactory.getDispatchReporter(ReporterFactory.scala:245)
            at org.scalatest.tools.Framework$ScalaTestRunner.<init>(Framework.scala:808)
            at org.scalatest.tools.Framework.runner(Framework.scala:1106)
            at sbt.ForkMain$Run.runTests(ForkMain.java:186)
            at sbt.ForkMain$Run.run(ForkMain.java:257)
            at sbt.ForkMain.main(ForkMain.java:99)
    
    opened by aloiscochard 29
  • Travis CI

    Travis CI

    This is proposition.

    To turn this on owner of repo should:

    • go to travis-ci.org
    • accounts (top right)
    • scalatest/scalatest ON

    => next commit to PR will force travis build. Due to plenty commits of changing docs, please keep in mind this

    I had to change a bit jvm options, to have successful compilation under travis, due to java.lang.OutOfMemoryError: GC overhead limit exceeded

    Here is https://travis-ci.org/dmakhno/scalatest/builds/18194382 Green!

    P.S. I took jdk settings from scalaz, they might be changed on demand.

    opened by dmakhno 28
  • scalatest 3.2.1 fails to print failed test cases in some scenarios

    scalatest 3.2.1 fails to print failed test cases in some scenarios

    I don't have a reproduction case yet, but will work on it. Does not happen with 3.2.0. This is just to let others chime in here as well with their reproduction case if any

    opened by anilkumarmyla 27
  • [WIP] Support cross-compilation to Scala Native, fix #1112

    [WIP] Support cross-compilation to Scala Native, fix #1112

    This PR needs a lot more work, but wanted to get it out there for an initial review and feedback. I have tested the Scala Native build of ScalaTest with another project (https://github.com/team846/potassium), and the basic functionality is working (with one Scala Native optimization phase disabled that currently crashes).

    Right now, the PR depends on unmerged PRs from ScalaTest's dependencies, such as ScalaCheck. Also right now the unit tests have not been ported to Scala Native, but I will be working on making them work next.

    cc @densh @Duhemm

    opened by shadaj 24
  • `thrownBy` results in

    `thrownBy` results in "discarded non-Unit value" warnings

    I add -Ywarn-value-discard to scalacOptions in my projects to help enforce a more explicit and less error-prone coding style.

    Unfortunately, this results in compiler warnings whenever I use the an [Exception] must be thrownBy { ... } syntax in my tests. The thrownBy method of ResultOfBeWordForAnType expects an expression of type => Unit rather than => Any, so in order to suppress these warnings, I have to use syntax like { 1 / 0; () } or { val _ = 1 / 0 }.

    This could be avoided by changing the method signature of thrownBy from (fun: => Unit): Unit to (fun: => Any): Unit. Interestingly enough, that's exactly the signature of the corresponding method of ResultOfBeWordForAType.

    opened by jawshooah 24
  • Publish for Scala 2.13.0-M4?

    Publish for Scala 2.13.0-M4?

    M4 JARs are on Maven Central now.

    This will probably be more work than the usual upgrades since code will need to be adapted to the new collections. Some advice on that:

    • dropping Scala 2.10 support will help
    • https://github.com/scala/collection-strawman/wiki/FAQ is your bible
    • consider using scala-collection-compat (though a great deal of collections-using code will still cross-compile without it)
    • ask questions (so we can help, and to help us improve the FAQ, too)
    opened by SethTisue 23
  • publish a 2.3.0-SNAPSHOT version

    publish a 2.3.0-SNAPSHOT version

    As in my experience not many people are aware of the effort to port scalatest over to Scala-js, I think it would be beneficial to publish a 2.3.0-SNAPSHOT version. This would also allow people to start playing with it and identify potential issues.

    If possible, can we include the new version of scalacheck + enable Matchers in it, given that unicredit/akka.js depends on it? Thank you!

    @cheeseng

    opened by yawnt 23
  • Update to Scalacheck 1.13

    Update to Scalacheck 1.13

    Scalacheck 1.13.0 is hot off the press and includes handy things like a fix for #661 and Cogen for generating "arbitrarier" functions. I'd like to see a version of scalatest that is compatible with this new Scalacheck, so then we can update the chain of discipline and then cats. Does this sound like something that can be done in the near future? I'm happy to help with the effort, but I wanted to check in before starting.

    opened by ceedubs 21
  • ScalaTest calls getSimpleName, which is unreliable in a Scala context

    ScalaTest calls getSimpleName, which is unreliable in a Scala context

    the calls have been there for years, so this can't be a common problem, but @travisbrown reports encountering this when upgrading Cats to use ScalaCheck 1.13.3:

    [info] cats.free.FreeTests *** ABORTED *** (24 milliseconds)
    [info]   java.lang.InternalError: Malformed class name
    [info]   at java.lang.Class.getSimpleName(Class.java:1330)
    [info]   at org.scalatest.enablers.UnitCheckerAsserting$CheckerAssertingImpl$$anonfun$check$6.apply(CheckerAsserting.scala:141)
    

    the (notorious) ticket on getSimpleName blowing up on certain Scala classes is https://issues.scala-lang.org/browse/SI-2034

    opened by SethTisue 20
  • Diagrams.assert calls Future two times

    Diagrams.assert calls Future two times

    One line assert from org.scalatest.diagrams.Diagrams calls Future two times:

    import org.scalatest.diagrams.Diagrams
    import org.scalatest.funsuite.AnyFunSuite
    import scala.concurrent.ExecutionContext.Implicits.global
    import scala.concurrent.duration.{Duration, SECONDS}
    import scala.concurrent.{Await, Future}
    
    class ReproduceTest extends AnyFunSuite with Diagrams {
      test("reproduce") {
        assert(Await.result(Future { println("in future"); 42 }, Duration(1, SECONDS)) == 42)
      }
    }
    

    result:

    in future
    in future
    

    Two line assert is ok:

        assert(Await.result(Future { println("in future"); 42 },
          Duration(1, SECONDS)) == 42)
    

    result:

    in future
    

    Checked versions:

    • scalatest 3.2.12, scala 2.13.7
    • scalatest 3.2.14, scala 3.2.1
    opened by antarcticer 1
  • GitHub Workflows security hardening

    GitHub Workflows security hardening

    This PR adds explicit permissions section to workflows. This is a security best practice because by default workflows run with extended set of permissions (except from on: pull_request from external forks). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an injection or compromised third party tool or action) is restricted. It is recommended to have most strict permissions on the top level and grant write permissions on job level case by case.

    cla-signed 
    opened by sashashura 3
  • [WIP] RoseTree Shrinking Filter and Having Size Support

    [WIP] RoseTree Shrinking Filter and Having Size Support

    • Added isValid to Generator, and map2WithFilter to RoseTree object.
    • Changed PropCheckerAsserting to use map2WithFilter and isValid to support filtering in RoseTree shrinking.
    • Added isValid to having size/between implementations.
    cla-signed 
    opened by cheeseng 0
  • Question: dependency between tests for ParallelTestExecution

    Question: dependency between tests for ParallelTestExecution

    I have tests using an item a of class A. Before the first test, a has to be preprocessed. This preprocessing involves part of the code so it has to be tested (btw it is taking most of the CPU time).

    For now I automatically add a preprocessing test before the first test using a. If the preprocessing fails, the prepended test is marked as failed and other tests using a are cancelled.

    Example

    It is for a DSL.

    a should "do something" inSim { dut =>
      // some code
    }
    
    a.test("some test") { dut =>
      // some code
    }
    

    Creates 3 tests:

    • a compiles: preprocessing test
    • a should do something: first user test
    • a test: some test: second user test

    I would like to run tests in parallel, which has two benefits: different instances of A can be preprocessed at the same time, also different tests on a same instance a of class A can be run at the same time.

    A solution could be to make sure the prepended test preprocessing a ends before the tests using a start. I cannot find a way to make scalatest enforce such "dependencies" rules.

    Another solution could be to group tests, enabling parallelism among test groups but not among tests of the same test group. It would not make it possible to run tests using the same A at the same time but it is not an issue because preprocessing a is the critical thing. I also have no clue about how to do that.

    opened by numero-744 2
  • Measuring duration of beforeAll, afterAll, beforeEach, afterEach

    Measuring duration of beforeAll, afterAll, beforeEach, afterEach

    Hey!

    Is it possible somehow to get information about tests beforeAll, afterAll, beforeEach, afterEach duration?

    For some integration tests I have complex setup and want to be aware how long it takes as test execution duration seems not include execution of those steps.

    Thanks in advance for any suggestions! As I couldn't find anything for now I just measure duration manually and log it in test logs but it is very hacky and hard later retrieve those times.

    Regards, Sebastian

    opened by sebarys 1
Releases(release-3.2.14)
  • release-3.2.14(Sep 29, 2022)

    Scalactic/ScalaTest 3.2.14 is a point release that makes a few enhancements.

    Changes included:

    • Set sorting reporter as complete if test run failed unexpected. (https://github.com/scalatest/scalatest/pull/2161)
    • Fixed serialization problem for TestFailedException thrown from EitherValues. (https://github.com/scalatest/scalatest/pull/2159)
    • Enabled scaladoc artifact for Scala 3 build. (https://github.com/scalatest/scalatest/pull/2163)
    • Marked matchers DSL with Scala 3 infix keyword. (https://github.com/scalatest/scalatest/pull/2158)
    • Enhanced pretty print support for case classes. (https://github.com/scalatest/scalatest/pull/2155)
    • Enhanced pretty print support for tuples. (https://github.com/scalatest/scalatest/pull/2160)
    • Changed the remaining GenTraversable in Prettifier to Iterable. (https://github.com/scalatest/scalatest/pull/2156)
    • Whenever possible call .hasDefiniteSize first before calling .size on collection. (https://github.com/scalatest/scalatest/pull/2156)

    Matthew de Detrich (https://github.com/mdedetrich) Nima Taheri (https://github.com/nimatrueway Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.13(Jul 31, 2022)

    Scalactic/ScalaTest 3.2.13 is a point release that makes a few enhancements.

    Changes included:

    • Fixed missing original error message in the error message raised by 'should compile' matcher in Scala 3, also made it to use different message for parse and type error. (https://github.com/scalatest/scalatest/pull/2125)
    • Added a more general approach to detect cyclic objects when traversing nested collections in Prettifier. (https://github.com/scalatest/scalatest/pull/2131)
    • Added truncateAt function to Prettifier companion to allow creation of default prettifier that will truncate collection at certain size before prettifying. (https://github.com/scalatest/scalatest/pull/2131)
    • WordSpec Error Message Enhancement: Propogate cause of TestFailedException and TestCanceledException in registerBranch and registerShorthandBranch function when the cause of NotAllowedException or DuplicateTestNameException. (https://github.com/scalatest/scalatest/pull/2132)
    • Do away with GenTraversable and GenMap in Prettifier. (https://github.com/scalatest/scalatest/pull/2134)
    • Updated to use Scala 3.1.3. (https://github.com/scalatest/scalatest/pull/2135)
    • Bug fix in HtmlReporter to throw ClassNotFoundException correctly. (https://github.com/scalatest/scalatest/pull/2138)
    • Change ConfigMapWrapperSuite to use wrapped suite's name and ID. (https://github.com/scalatest/scalatest/pull/2142)
    • Scala 3: Use open class for concrete classes for style classes. (https://github.com/scalatest/scalatest/pull/2146)
    • Enhanced cannotLoadDiscoveredSuite error message to include class name and error message. (https://github.com/scalatest/scalatest/pull/2148)
    • Updated to use scala-native 0.4.5.

    Thanks to the contributors for the Scalactic/ScalaTest 3.2.13 release:

    Naftoli Gugenheim (https://github.com/nafg) Jacob Wood (https://github.com/JMdoubleU) Andrzej Wąsowski (https://github.com/wasowski) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.12(May 6, 2022)

    ScalaTest 3.2.12 is a point release of ScalaTest that makes a few enhancements.

    Changes included:

    • Get JUnitXmlReporter to handle SuiteAborted event correctly. (https://github.com/scalatest/scalatest/pull/2103)
    • Handle DeferredAbortedSuite correctly when firing SuiteStarting, SuiteCompleted and SuiteAborted in multiple places. (https://github.com/scalatest/scalatest/pull/2103)
    • Tweaked failure XML tag in JUnit xml to show only error message in its message attribute, and the stack trace only in the tag body. (https://github.com/scalatest/scalatest/pull/2103)
    • Resurrected -S Generator Seed Argument. (https://github.com/scalatest/scalatest/pull/2104, https://github.com/scalatest/scalatest/pull/2106)
    • Macro Enhancement for OrderingOps. (https://github.com/scalatest/scalatest/pull/2107)
    • Dropped the use of UUID in TestSortingReporter, replaced with object identity approach. (https://github.com/scalatest/scalatest/pull/2118)
    • Updated to use Scala-XML 2.1.0. (https://github.com/scalatest/scalatest/pull/2119)
    • Added Scala-native build for Scala 3. (https://github.com/scalatest/scalatest/pull/2120)
    • Updated to use Scala-js 1.8.0. (https://github.com/scalatest/scalatest/pull/2121)
    • Updated to use Scala 3.1.0. (https://github.com/scalatest/scalatest/pull/2120)
    • Updated to use Scala-native 0.4.4. (https://github.com/scalatest/scalatest/pull/2106)

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.12 release:

    Guillaume Martres (https://github.com/smarter) Sébastien Doeraene (https://github.com/sjrd) Kirill A. Korinsky (https://github.com/catap) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.11(Jan 25, 2022)

    ScalaTest 3.2.11 is a point release of ScalaTest that makes a few enhancements.

    Changes included:

    • Changed Valuable class in EitherValues to EitherValuable, and in OptionValues to OptionValuable, for Scala 3 build. (#2094)
    • Fixed crashing problem when encounters non-serializable throwable or payload in exceptions when running in fork mode by wrapping them as NotSerializableWrapperException or None. (#2086)
    • Fire RunAborted event when error in creating dispatch reporter, fixing hang problem when it happens. (#2090)
    • Enhanced checkInOrder implementation in Sequencing.scala to allow other objects to appear in right-hand aggregation as well. (#2072)
    • Enhanced Scala 3 macro to support OrderingOps correctly. (#2089)
    • Updated to use scala-js 1.7.1. (#2067)
    • Updated to use Ant 1.10.12. (#2091)
    • Updated to scala-xml 2.0.1 for Scala 2.12 and above builds. (#2093)
    • Updated to use scala-native 0.4.3. (#2098)

    Daniel Wojda (https://github.com/wojda) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.10(Sep 20, 2021)

    ScalaTest 3.2.10 is a point release of ScalaTest that makes a few enhancements.

    Changes included:

    • Fixed compilation error if Repeated is included in Diagrams assertion (https://github.com/scalatest/scalatest/pull/2037)
    • scaladoc broken links fix (https://github.com/scalatest/scalatest/pull/2041)
    • Backport produceMatcher Fix for Scala 3 (https://github.com/scalatest/scalatest/pull/2045)
    • Updated Scala-js to 1.7.0 (https://github.com/scalatest/scalatest/pull/2055)
    • Updated Scala 3 to 3.0.2 (https://github.com/scalatest/scalatest/pull/2055)
    • Updated Flexmark version to 0.62.2 (https://github.com/scalatest/scalatest/pull/2050)
    • Fixed javascript error in html reports generated under Scala 3 (https://github.com/scalatest/scalatest/pull/2050)
    • Give a friendly message when Flexmark not available on classpath (https://github.com/scalatest/scalatest/pull/2050)
    • Enhanced Scala 3 position support (https://github.com/scalatest/scalatest/pull/2053)
    • Made Retrying[Future[T]] to retry even when the code to produce the Future[T] fails with exception (https://github.com/scalatest/scalatest/pull/2061)
    • Enabled the should compile and shouldNot compile syntax support for """ string in Scala 3 (https://github.com/scalatest/scalatest/pull/2063)

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.10 release:

    Taisuke Oe (https://github.com/taisukeoe) Sandor Kelemen (https://github.com/kelemensanyi) Seth Tisue (https://github.com/SethTisue) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.9(May 17, 2021)

    ScalaTest 3.2.9 is a point release of ScalaTest that makes a few enhancements.

    Changes included:

    • Improved support for Scala 3.
    • Included release with Scala 3.0.0.
    • Moved DiagrammedExpr into org.scalatest.diagrams package.

    Deprecations:

    • DiagrammedExpr in org.scalatest package is now deprecated and will be removed in the future version of ScalaTest, please use DiagrammedExpr in org.scalatest.diagrams package.

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.9 release:

    Guillaume Martres (https://github.com/smarter) Tom Grigg (https://github.com/griggt) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.8(Apr 22, 2021)

    ScalaTest 3.2.8 is a point release of ScalaTest that makes a few bug fixes and enhancements.

    Changes included:

    • Fixed JUnit XML Invalid Output (https://github.com/scalatest/scalatest/pull/1996).
    • Fixed NullPointerException problem when Scala 3 Position macro is used in REPL (https://github.com/scalatest/scalatest/pull/2001).
    • Enhanced Scala 3 version of Assertions' assertResult, shouldBe and mustBe matchers with scala.CanEqual support (https://github.com/scalatest/scalatest/pull/2002).
    • Fixed stripMargin problem in Scala 3 build (https://github.com/scalatest/scalatest/pull/2005).
    • Updated to build with Scala 3.0.0-RC3 (https://github.com/scalatest/scalatest/pull/2009).

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.8 release:

    Donald McLean (https://github.com/dmclean62) Simmo Saan (https://github.com/sim642) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.7(Apr 2, 2021)

    ScalaTest 3.2.7 is a point release of ScalaTest that makes a few enhancements.

    Changes included:

    • Updated to build with Scala 3.0.0-RC2.
    • Added Scala-js build for Scala 3.0.0-RC2.
    • Updated to build with Scala-js 1.5.0.

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.7 release:

    Tom Grigg (https://github.com/griggt) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.6(Mar 9, 2021)

    ScalaTest 3.2.6 is a point release of ScalaTest that makes a few enhancements.

    Changes included:

    • Load the new correct wrapper class for JUnit and TestNG.
    • Changed to use scala-xml 2.0.0-M5 for Scala 3 build.
    • Updated to use scala-xml 1.3.0 for Scala 2 build.

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.6 release:

    Seth Tisue (https://github.com/SethTisue) Gabriel Russo (https://github.com/gabrielrussoc) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.5(Feb 24, 2021)

    ScalaTest 3.2.5 is a point release of ScalaTest that makes a few enhancements.

    Changes included:

    • Undo source breaking change in Future's futureValue function by mistake in 3.2.4 which required ().
    • Rewritten Retrying.scala to do away with lazy val scheduler in object Retrying which is not shutdown, replaced with approach where new instance of scheduler is created every time and .shutdown() is called right after the intended task is scheduled with it, this way the scheduler will shutdown after the scheduled task completes its execution.

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.5 release:

    Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.4(Feb 19, 2021)

    ScalaTest 3.2.4 is a point release of ScalaTest that makes a few enhancements.

    Changes included:

    • Improved support for Scala 3.
    • Upgraded to Scala 3.0.0-RC1.
    • Upgraded to use Scala 2.13.4
    • Upgraded to use Scala Native 0.4.0
    • Changed to use String's .linesIterator in NumericString.

    Note: There's a source breaking change in Futures's futureValue function by mistake which required (), it will be fixed by a follow-up 3.2.5 very soon.

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.4 release:

    Kirill A. Korinsky (https://github.com/catap) Guillaume Martres (https://github.com/smarter) Nicolas Stucki (https://github.com/nicolasstucki) Fengyun Liu (https://github.com/liufengyun) Seth Tisue (https://github.com/SethTisue) Ondra Pelech (https://github.com/sideeffffect) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.2.3(Nov 10, 2020)

    ScalaTest 3.2.3 is a point release of ScalaTest that makes a few enhancements and fixes a few bugs.

    Changes included:

    • Fixed NotSerializableException when TryValues or EitherValues raise assertion failure. (https://github.com/scalatest/scalatest/pull/1884)
    • Bump sbt-osgi version to 0.9.6, for JDK 15 compat (https://github.com/scalatest/scalatest/pull/1899)
    • Updated to use Scala-js 1.3.0.
    • Updated to use Dotty 1.0.0-M1.

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.3 release:

    Sébastian Le Merdy (https://github.com/seblm) Seth Tisue (https://github.com/SethTisue) Chua Chee Seng (https://github.com/cheeseng) Bill Venners (https://github.com/bvenners)

    Source code(tar.gz)
    Source code(zip)
  • release-3.0.9(Sep 23, 2020)

    ScalaTest 3.0.9 is a point release of ScalaTest that backported critical bug fixes and a few enhancements from 3.1.x.

    Changes included:

    • Only expect non-filtered Async tests to be reported as completed in AsyncEngine, ParallelTestExecution and RandomTestOrder, which causes incorrect test count reported.
    • In SuiteSortingReporter, only remove suite reporter after the SuiteCompleted event is reported correctly.
    • Improved support for Symbol in Prettifier and PrivateMethodTester.
    • Updated scala-js version to 0.6.33.
    • Updated scalacheck version to 1.14.3.
    • Rewritten SuiteSortingReporter and TestSortingReporter to create timer instance only when required, avoiding creating the timer thread when it is not needed.
    • Changed SuiteRunner so that the behavior of handling fatal error in parallel execution is consistent with execution in serial.

    Thanks to the contributors for the ScalaTest/Scalactic 3.0. release:

    • John Duffell (https://github.com/johnduffell)
    • Seth Tisue (https://github.com/SethTisue)
    • Chua Chee Seng (https://github.com/cheeseng)
    • Bill Venners (https://github.com/bvenners)
    Source code(tar.gz)
    Source code(zip)
  • release-3.2.2(Sep 5, 2020)

    ScalaTest 3.2.2 is a point release of ScalaTest that makes a few enhancements and fixes a few bugs.

    Changes included:

    • Remove suite reporter only when the suite's tests are completed. (https://github.com/scalatest/scalatest/issues/1876)
    • Skip Await.ready call overhead when the future is already completed at the call site.
    • Report actual value of unexpected Try projection.
    • Report actual value of unexpected Either projection.
    • Changed SuiteRunner so that the behavior of handling fatal error in parallel execution is consistent with execution in serial. (https://github.com/scalatest/scalatest/issues/1870)
    • Enhanced ObjectDiffer to handle diff-ing of objects with cyclic dependency. (https://github.com/scalatest/scalatest/issues/1871)
    • Updated flexmark to 0.36.8.

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.2 release:

    • Robert Elliot (https://github.com/Mahoney)
    • Chua Chee Seng (https://github.com/cheeseng)
    • Bill Venners (https://github.com/bvenners)
    Source code(tar.gz)
    Source code(zip)
  • release-3.1.4(Sep 5, 2020)

    ScalaTest 3.1.4 is a point release of ScalaTest that makes a few enhancements and fixes a few bugs.

    Changes included:

    • Remove suite reporter only when the suite's tests are completed. (#1876)
    • Skip Await.ready call overhead when the future is already completed at the call site.
    • Changed SuiteRunner so that the behavior of handling fatal error in parallel execution is consistent with execution in serial. (#1870)
    • Enhanced ObjectDiffer to handle diff-ing of objects with cyclic dependency. (#1871)
    • Updated flexmark to 0.36.8.

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.2 release:

    • Chua Chee Seng (https://github.com/cheeseng)
    • Bill Venners (https://github.com/bvenners)
    Source code(tar.gz)
    Source code(zip)
  • release-3.2.1(Aug 11, 2020)

    ScalaTest 3.2.1 is a point release of ScalaTest that makes a few enhancements and fixes a few bugs, and supports Scala.js 1.1.1 and Dotty 0.26.

    Changes included:

    • Fix IllegalAccessException when comparing 2 instances of class has private fields. (https://github.com/scalatest/scalatest/pull/1834)
    • Only expect non-filtered Async tests to be reported as completed in AsyncEngine, ParallelTestExecution and RandomTestOrder, which causes incorrect test count reported. (https://github.com/scalatest/scalatest/pull/1842)
    • In SuiteSortingReporter, only remove suite reporter after the SuiteCompleted event is reported correctly. (https://github.com/scalatest/scalatest/pull/1844)
    • Added support of asynchronous test in scalatest native build. (https://github.com/scalatest/scalatest/pull/1858)
    • Improved Futures support by avoiding polling in Scala futures. (https://github.com/scalatest/scalatest/pull/1861)
    • Fixed incorrect succeeded value in CompositeStatus (https://github.com/scalatest/scalatest/pull/1868)

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.1 release:

    • Nguyen Hong Phuc (https://github.com/phucnh)
    • John Duffell (https://github.com/johnduffell)
    • Nicolas Stucki (https://github.com/nicolasstucki)
    • Guillaume Martres (https://github.com/smarter)
    • Bùi Việt Thành (https://github.com/giabao)
    • Kirill A. Korinsky (https://github.com/catap)
    • Arnout Engelen (https://github.com/raboof)
    • Tim Zhlobich (https://github.com/tim-zh)
    • Chua Chee Seng (https://github.com/cheeseng)
    • Bill Venners (https://github.com/bvenners)
    Source code(tar.gz)
    Source code(zip)
  • release-3.1.3(Aug 11, 2020)

    ScalaTest 3.1.3 is a point release of ScalaTest that makes a few enhancements and fixes a few bugs, and supports Scala.js 1.1.1 and Dotty 0.26.

    Changes included:

    • Fix IllegalAccessException when comparing 2 instances of class has private fields. (https://github.com/scalatest/scalatest/pull/1859)
    • Only expect non-filtered Async tests to be reported as completed in AsyncEngine, ParallelTestExecution and RandomTestOrder, which causes incorrect test count reported. (https://github.com/scalatest/scalatest/pull/1838)
    • In SuiteSortingReporter, only remove suite reporter after the SuiteCompleted event is reported correctly. (https://github.com/scalatest/scalatest/pull/1850)
    • Added support of asynchronous test in scalatest native build. (https://github.com/scalatest/scalatest/pull/1867)
    • Improved Futures support by avoiding polling in Scala futures. (https://github.com/scalatest/scalatest/pull/1794)

    Thanks to the contributors for the ScalaTest/Scalactic 3.2.1 release:

    • Arnout Engelen (https://github.com/raboof)
    • Tim Zhlobich (https://github.com/tim-zh)
    • John Duffell (https://github.com/johnduffell)
    • Guillaume Martres (https://github.com/smarter)
    • Nicolas Stucki (https://github.com/nicolasstucki)
    • Nguyen Hong Phuc (https://github.com/phucnh)
    • Kirill A. Korinsky (https://github.com/catap)
    • Bùi Việt Thành (https://github.com/giabao)
    • Chua Chee Seng (https://github.com/cheeseng)
    • Bill Venners (https://github.com/bvenners)
    Source code(tar.gz)
    Source code(zip)
  • release-3.2.0(Jun 20, 2020)

  • release-3.1.2(May 13, 2020)

    ScalaTest 3.1.2 is a minor release of ScalaTest that makes a few changes, and supports Scala.js 1.0.1 and Dotty 0.23.

    Changes included:

    • Be Scala 2.13.3 friendly (Symbol#toString change)
    • Dotty 0.23.0 support.
    • Built with Scala.js 1.0.1.
    Source code(tar.gz)
    Source code(zip)
  • release-3.1.1(Feb 21, 2020)

    ScalaTest 3.1.1 is a minor release of ScalaTest that makes a few enhancements and fixes a few bugs, and supports Scala.js 1.0.0 and Dotty 0.22.

    Changes included:

    • Report unexpected value of Try in TryValues (https://github.com/scalatest/scalatest/pull/1738).
    • Report unexpected value of Either in EitherValues. (https://github.com/scalatest/scalatest/pull/1738)
    • Updates, especially to macros, to support Dotty 0.22.
    • Updates to support Scala.js 1.0.0.
    • Use cached thread pool unless explicit thread count given during parallel execution. (https://github.com/scalatest/scalatest/pull/1760)
    • Fixed invalid property element in JUnit XML (https://github.com/scalatest/scalatest/issues/1767)
    • Fixed stray timers in SuiteSortingReporter and TestSortingReporter. (https://github.com/scalatest/scalatest/pull/1774)

    Thanks to the contributors for the ScalaTest/Scalactic 3.1.1 release:

    • Robert Elliot (https://github.com/Mahoney)
    • Nicolas Stucki (https://github.com/nicolasstucki)
    • Fengyun Liu (https://github.com/liufengyun)
    • Seth Tisue (https://github.com/SethTisue)
    • Chua Chee Seng (https://github.com/cheeseng)
    • Travis Brown (https://github.com/travisbrown)
    • Lorenz Mende (https://github.com/LorenzMende)
    • Bill Venners (https://github.com/bvenners)
    Source code(tar.gz)
    Source code(zip)
  • release-3.1.0(Nov 29, 2019)

  • release-3.1.0-RC3(Oct 31, 2019)

  • release-3.0.8(Jun 13, 2019)

    Fixes

    • Duplicate classes of JMock, JUnit, ScalaCheck, TestNG, EasyMock, and Selenium to org.scalatestplus.xxx packages, this fix problem for user using them from Java.
    • Added root to the macros defined in TypeMatcherMacro.
    • Changed Framework to flavour @WrapWith when it is available, consistent with behaviour of ScalaTestFramework and Runner.
    • Fixed javascript error in report files generated by HtmlReporter.

    Enhancements

    • Make Prettifier to not depends on scala-xml classes, and removed scala-xml dependency from scalactic.
    • Make StringOps in Prettifier to be compatible with Scala 2.13.0, all tests in AssertionsSpec now passes.
    • Made Every's groupBy method to behave consistently in Scala 2.13.0.
    • Use collection prefix from toString for ColCompatHelper's className implementation of Scala 2.13.0.
    • Updated to use scala-js 0.6.28, 1.0.0-M3 and 1.0.0-M8.

    Deprecations

    • Deprecated org.scalatest.enablers.CheckerAsserting in favour of org.scalatestplus.scalacheck.CheckerAsserting.
    Source code(tar.gz)
    Source code(zip)
  • release-3.0.7(Mar 19, 2019)

    This release has the same functionality as 3.0.6, and should be source compatible with 3.0.6, but unlike 3.0.6, is binary compatible with 3.0.5. Please see the release notes for 3.0.6 to find out the details of what the release contains. The goal with this release it to achieve binary compatibility with 3.0.5. Unfortunately although 3.0.6 should be source compatible with 3.0.5, it was not binary compatible.

    Source code(tar.gz)
    Source code(zip)
  • release-3.0.7-RC1(Mar 8, 2019)

    This release has the same functionality as 3.0.6, and should be source compatible with 3.0.6, but unlike 3.0.6, is binary compatible with 3.0.5. Please see the release notes for 3.0.6 to find out the details of what the release contains. The goal with this release it to achieve binary compatibility with 3.0.5. Unfortunately although 3.0.6 should be source compatible with 3.0.5, it was not binary compatible.

    Source code(tar.gz)
    Source code(zip)
  • release-3.0.6(Mar 1, 2019)

    Bug Fixes

    • Fixed incorrect test count problem in scala-js starting 0.6.22.
    • Fixed problem when partial unification is enabled with -Ypartial-unification.
    • Enhanced TypeMatcherHelper to handle primitive types checking.
    • Enhanced TypeMatcherHelper to handle AnyVal correctly.

    Improvements

    • Moved away from using octal escapes, as they are deprecated and will be removed in Scala 2.13.
    • Wrap <script> sections of HtmlReporter in <![CDATA[]]>.
    • Bumped up to use ScalaCheck 1.14.0.
    • Bumped up to use scala-xml version 1.1.0.
    • Bumped up to use scala-js version 0.6.26.
    • Added support for Scala 2.13.0-M5.

    Enhancements

    • Added support of -T argument in SBT.

    Deprecations

    • Deprecated 'to' and 'until' method in Float and Double anyvals.
    • Deprecated ScalaCheck related classes in org.scalatest.prop, moved the classes into org.scalatestplus.scalacheck.
    • Deprecated classes in org.scalatest.easymock, moved the classes into org.scalatestplus.easymock
    • Deprecated classes in org.scalatest.jmock, moved the classes into org.scalatestplus.jmock.
    • Deprecated classes in org.scalatest.junit, moved the classes into org.scalatestplus.junit.
    • Deprecated classes in org.scalatest.mockito, moved the classes into org.scalatestplus.mockito.
    • Deprecated classes in org.scalatest.selenium, moved the classes into org.scalatestplus.selenium.
    • Deprecated classes in org.scalatest.testng, moved the classes into org.scalatestplus.testng.

    Autofix for ScalaTest 3.0

    To help user to migrate from deprecated packages to new packages, we include a autofix tool that can help you to rename the package automatically.

    If you're using the latest Scala 2.11 or 2.12, you can follow this guide to use autofix:

    https://github.com/scalatest/autofix/tree/master/3.0.6

    Source code(tar.gz)
    Source code(zip)
  • release-3.0.5(Feb 13, 2018)

    ScalaTest

    Bug Fixes:

    • Fixed implicit view not available problem when used with compile macro.
    • Fixed stack depth problem in RefSpecLike and fixture.SpecLike under Scala 2.13.
    • Changed Framework and ScalaTestFramework to set spanScaleFactor for Runner object instance for different Runner using different class loader, this fixed incorrect Runner.spanScaleFactor being used when multiple sbt projects tests run concurrently.
    • Fixed a bug in endsWith regex matcher.

    Improvements:

    • Removed duplicated parsing code for -C in ArgsParser.
    • Improved performance in WebBrowser.
    • Documentation typo rectification.
    • Improve validity of Junit XML reports.
    • Improved performance by replacing all .size == 0 and .length == 0 to .isEmpty.

    Enhancements:

    • Added 'C' option to -P, which will tells -P to use cached thread pool.

    External Dependencies Update:

    • Bumped up scala-js version to 0.6.22.
    • Changed to depend on mockito-core, not mockito-all.
    • Bumped up jmock version to 2.8.3.
    • Bumped up junit version to 4.12.
    • Removed depedency to scala-parser-combinators.

    Scalactic

    Bug Fixes:

    • Fixed Accumulation's Combinable problem when used with ScalaTest's shouldEqual.

    Improvements:

    • Pretty print ArrayOps.
    • Improved performance by replacing all .size == 0 and .length == 0 to .isEmpty.

    External Dependencies Update:

    • Bumped up scala-js version to 0.6.22.

    Notes for 3.0.5-M1

    The M1 release is created for Scala 2.13.0-M3, which we detected a potential regression when building ScalaTest's own tests. You can use 3.0.5-M1 if you need to cross build with Scala 2.13.0-M3. For further details, please see:

    https://github.com/scalatest/scalatest/issues/1321#issuecomment-365005265

    Source code(tar.gz)
    Source code(zip)
  • release-3.0.4(Oct 6, 2017)

    Version 3.0.4 for Scala 2.10, 2.11 and 2.12.

    Bug Fixes:

    • Avoid race condition in Timed.scala. View details here: https://github.com/scalatest/scalatest/issues/1147

    Enhancements:

    • Updated scala-js version to 0.6.16.
    Source code(tar.gz)
    Source code(zip)
  • release-3.0.3(Apr 20, 2017)

    Version 3.0.3 for Scala 2.10, 2.11 and 2.12.

    Bug Fixes: -Fixed java classes in artifacts built for Scala 2.10 and 2.11 (Java 6 supported needed) was compiled with Java 8 problem. You can see details of the problem described here: https://github.com/scalatest/scalatest/issues/1141

    Source code(tar.gz)
    Source code(zip)
  • release-3.0.2(Apr 18, 2017)

    Version 3.0.2 for Scala 2.10, 2.11 and 2.12.

    Enhancements:

    • Pulled out commons-io, jetty dependencies from scalatest artifact's pom.xml, they are used by our tests only.
    • Updated easymock version to 3.2.
    • Updated jmock version to 2.8.1.
    • Updated mockito version to 1.10.19.
    • Updated guice version to 4.0.
    • Updated selenium version to 2.45.0.
    • Updated testng version to 6.7.
    • Switch to use the more stable getSimpleNameOfAnObjectsClass in place of getClass.getSimpleName.
    Source code(tar.gz)
    Source code(zip)
Owner
ScalaTest
ScalaTest
Java testing framework for testing pojo methods

Java testing framework for testing pojo methods. It tests equals, hashCode, toString, getters, setters, constructors and whatever you report in issues ;)

Piotr Joński 48 Aug 23, 2022
Never debug a test again: Detailed failure reports and hassle free assertions for Java tests - Power Asserts for Java

Scott Test Reporter for Maven and Gradle Get extremely detailed failure messages for your tests without assertion libraries, additional configuration

Dávid Csákvári 133 Nov 17, 2022
JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

pact-jvm JVM implementation of the consumer driven contract library pact. From the Ruby Pact website: Define a pact between service consumers and prov

Pact Foundation 962 Dec 31, 2022
Apache JMeter - An Open Source Java application designed to measure performance and load test applications

An Open Source Java application designed to measure performance and load test applications. By The Apache Software Foundation What Is It? Apache JMete

The Apache Software Foundation 6.7k Jan 1, 2023
Utility to automatically manage all web element waits and enables to write wait-free selenium tests.

selenium-auto-wait selenium-auto-wait automatically manages all weblement waits and makes you to write wait free selenium tests. Features Waits till e

Sudharsan Selvaraj 31 Nov 1, 2022
A modern testing and behavioural specification framework for Java 8

Introduction If you're a Java developer and you've seen the fluent, modern specification frameworks available in other programming languages such as s

Richard Warburton 250 Sep 12, 2022
Advanced Java library for integration testing, mocking, faking, and code coverage

Codebase for JMockit 1.x releases - Documentation - Release notes How to build the project: use JDK 1.8 or newer use Maven 3.6.0 or newer; the followi

The JMockit Testing Toolkit 439 Dec 9, 2022
A powerful open source test automation platform for Web Apps, Mobile Apps, and APIs

A powerful open source test automation platform for Web Apps, Mobile Apps, and APIs. Build stable and reliable end-to-end tests @ DevOps speed.

Testsigma Technologies Inc 466 Dec 31, 2022
AllPairs4J - an open source Java library for generation of minimal set of test combinations

AllPairs4J AllPairs4J is an open source Java library for generation of minimal set of test combinations. AllPairs4J is a Java port of allpairspy proje

Pavel Nazimok 5 Dec 11, 2022
fabric-carpet extension mod which attempts to fix as many vanilla bugs as possible. Feel free to add as many fixes as you want!

Carpet-Fixes Fabric Carpet extension mod which attempts to fix as many vanilla bugs as possible! Feel free to contribute by adding as many fixes as yo

Fx Morin 90 Jan 6, 2023
A FREE Selenium course that takes you step-by-step through building a custom Selenium Framework from scratch.

Selenium For Everyone The book and code repo for the FREE Selenium For Everyone book by Kevin Thomas. FREE Book Download Chapter 1: Getting Started Th

Kevin Thomas 5 May 10, 2022
The Enterprise-ready testing and specification framework.

Spock Framework Spock is a BDD-style developer testing and specification framework for Java and Groovy applications. To learn more about Spock, visit

Spock Framework 3.3k Jan 5, 2023
Layout and functional testing framework for websites

Galen Framework master: Galen is an open-source tool for testing layout and responsive design of web applications. It is also a powerfull functional t

Galen Framework 1.4k Dec 10, 2022
Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of usi

REST Assured 6.2k Dec 31, 2022
A programmer-oriented testing framework for Java.

JUnit 4 JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. For more infor

JUnit 8.4k Jan 4, 2023
Java DSL for easy testing of REST services

Testing and validation of REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of usi

REST Assured 6.2k Dec 25, 2022
Isolated MinIO container management for Java code testing

TestContainers for MinIO MinIO support for the test containers project. Installation Unfortunately, TestContainers for MinIO is not available in any p

Olsi Qose 3 Sep 30, 2022
Core for open source libraries, included some important Classes for those libs.

OpenSource Core You could also read the CHINESE version of README This is a very useful Java class library. In this update, we have merged the origina

Theodore Hills 10 Nov 16, 2022