0

Seems like I can't access shouldMatchJson matcher from Kotlintest v3.4.2 the way is documented in https://github.com/kotlintest/kotlintest/blob/master/doc/matchers.md. I get unresolved reference and I seem unable to import it. The code says it's an extension method to String class but tried with strings and even """{}""" but can't access that method. Am I doing something wrong? All other matchers are ok.

class Test : StringSpec ({
    "Test a json" {
        "{}".shouldMatchJson("{}")
    }
})

unresolved reference

jpablo
  • 1

1 Answers1

3

Could it be that you are missing the import for the json extension?

I have this in my build.gradle:

testImplementation "io.kotlintest:kotlintest-assertions-json:3.4.2"
  • 1
    Thanks that was exactly. I tried to search for this and could not find it even in the docs. I wonder why the readme doesn't say it or maybe I missed it. – jpablo Nov 15 '19 at 15:53