Hey everyone! What could be causing the error in t...
# getting-started
s
Hey everyone! What could be causing the error in this code?
a
Your class-declaration is missing the constructor, as the error-message explains (only the location with line 7 is misleading, the compiler misses the constructor only after finding the next symbol after that, which happens to be the
@Test
). Actually, it should be
Copy code
class Program1Tests() {
s
Oh, thanks! But I believe it's possible to omit defining a constructor, right?
a
Yes, you are right, the constructor is not needed here. I think your project-setup is wrong, you should check against this instructions: https://kotlinlang.org/docs/jvm-test-using-junit.html I guess, since the type
kotlin.test.Test
is only a typealias for the actual Test-annotation for different testing frameworks, the error comes from not finding any implementing testing framework: https://kotlinlang.org/api/core/kotlin-test/kotlin.test/-test/