From b63677aa98b0401227d1ca625557525f60a4293b Mon Sep 17 00:00:00 2001 From: Zaza Date: Thu, 16 Jul 2020 01:01:20 +0400 Subject: [PATCH 1/2] filter jasmine out in stackframes --- README.md | 2 +- .../robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt | 2 +- .../test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d7ce2bb69..fae041db8 100644 --- a/README.md +++ b/README.md @@ -466,7 +466,7 @@ expected that subject: () -> kotlin.Nothing (readme.examples.ReadmeSpec$1 Notice that stacks are filtered so that you only see what is of interest. Filtering can be configured via [`ReporterBuilder`](#reporterbuilder) by choosing an appropriate [AtriumErrorAdjuster](https://docs.atriumlib.org/latest#/doc/ch.tutteli.atrium.reporting/-atrium-error-adjuster/index.html). -Stack frames of Atrium and of test runners (Spek, Kotlintest and JUnit for JVM, mocha for JS) are excluded per default. +Stack frames of Atrium and of test runners (Spek, Kotlintest and JUnit for JVM, mocha and jasmine for JS) are excluded per default. [Create a Feature Request](https://github.com/robstoll/atrium/issues/new?template=feature_request.md&title=[Feature]) in case you use a different runner, we can add yours to the list as well. diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt index 45bc4cae2..890d6cfe9 100644 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt +++ b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt @@ -8,6 +8,6 @@ actual class RemoveRunnerAtriumErrorAdjuster : FilterAtriumErrorAdjuster(), Atri } companion object { - val runnerRegex: Regex = Regex("[\\\\|/]mocha[\\\\|/]") + val runnerRegex: Regex = Regex("[\\\\|/](mocha|jasmine)[\\\\|/]") } } diff --git a/samples/js/jasmine/src/test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt b/samples/js/jasmine/src/test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt index 0eccac35b..3b76fd645 100644 --- a/samples/js/jasmine/src/test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt +++ b/samples/js/jasmine/src/test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt @@ -27,6 +27,7 @@ class SampleJsTest { throw IllegalArgumentException("oho... hello btw") }.toThrow { messageContains("hello") + messageContains("jasmine") } } From b95925c49d11eafa867444fc2551c58831d00035 Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Wed, 19 Aug 2020 22:06:46 +0200 Subject: [PATCH 2/2] filter jasmine (mocha) only out if sub-dir of node_modules --- .../robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt | 2 +- .../test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt index 890d6cfe9..9c37f2d64 100644 --- a/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt +++ b/core/robstoll-lib/atrium-core-robstoll-lib-js/src/main/kotlin/ch/tutteli/atrium/core/robstoll/lib/reporting/RemoveRunnerAtriumErrorAdjuster.kt @@ -8,6 +8,6 @@ actual class RemoveRunnerAtriumErrorAdjuster : FilterAtriumErrorAdjuster(), Atri } companion object { - val runnerRegex: Regex = Regex("[\\\\|/](mocha|jasmine)[\\\\|/]") + val runnerRegex: Regex = Regex("[\\\\|/]node_modules[\\\\|/](mocha|jasmine)[\\\\|/]") } } diff --git a/samples/js/jasmine/src/test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt b/samples/js/jasmine/src/test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt index 3b76fd645..0eccac35b 100644 --- a/samples/js/jasmine/src/test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt +++ b/samples/js/jasmine/src/test/kotlin/org/atriumlib/samples/jasmine/SampleJsTest.kt @@ -27,7 +27,6 @@ class SampleJsTest { throw IllegalArgumentException("oho... hello btw") }.toThrow { messageContains("hello") - messageContains("jasmine") } }