Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show more than first line when using mocha test runner #691

Closed
robstoll opened this issue Nov 12, 2020 · 1 comment · Fixed by #955
Closed

show more than first line when using mocha test runner #691

robstoll opened this issue Nov 12, 2020 · 1 comment · Fixed by #955
Assignees
Milestone

Comments

@robstoll
Copy link
Owner

Platform (all, jvm, js): js
Extension (none, kotlin 1.3): none

Code related feature

It seems like mocha or maybe also the gradle plugin of Jetbrains is configured per default in a way that we see only the first line of an error in the terminal. We see the full message in the resulting gradle test report html though.

It would be nice, if we would see the whole message and not just the first line.
I am totally not sure how to do this, can only give the following hint, that it might be we can configure mocha somehow via the following (in samples/js/build.gradle)

kotlin {
    js {
        nodejs{
            testTask{
                useMocha{
                        // config here
                }
            }
        }
    }
}

I suggest you let /samples/js/src/test/kotlin/org/atriumlib/samples/mocha/SampleJsTest.kt fail on purpose (e.g. set toBe(2)) and run the sample afterwards:

cd samples/js
./gradlew buil
@wordhou
Copy link
Collaborator

wordhou commented Jul 13, 2021

While digging around in the gradle.build.kts files while working on #873, I figured out the configuration settings to change this:

kotlin {
    js {
        nodejs {
            testTask {
                testLogging {
                    exceptionFormat = TestExceptionFormat.FULL // Show full exception when an assertion fails
                }
            }
        }
    }
}

This is in the kotlin dsl but I believe it would be the same in Groovy. I'll post a PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants