kotest

withData는 중첩 테스트기 때문에 outer test에서 사용해야 한다. FreeSpec // error "test" { withData(1,2,3) { //.. } } // ok "test" - { withData(1,2,3) { //.. } } ShouldSpec context("test") { withData(1,2,3) { // .. } } Spyk - recordPrivateCalls 속성을 이용하면 private 메소드를 손 쉽게 mocking할 수 있다. kotest private 메소드 mocking val target = spyk(Service(), recordPrivateCalls = true) "test" { every { target["validate"](obj) } retur..
setup dependency 추가 tasks.withType().configureEach { useJUnitPlatform() } // Test Framework testImplementation('io.kotest:kotest-runner-junit5:5.5.4') // Assertions Library testImplementation('io.kotest:kotest-assertions-core:5.5.4') Kotest intellij plugin 설치 Testing Style kotest는 10개의 레이아웃을 제공하며, 이 중 하나를 상속받아서 사용 가능 여러 테스트 프레임워크에서 영감을 받아 작성된 레이아웃도 존재 사용하면 편할 것 같은 레이아웃을 몇 개 살펴보면 Should Spec Beha..
깡냉쓰
'kotest' 태그의 글 목록