# Testing functions with lambdas using MockK

DevFeed: [Testing functions with lambdas using MockK](<https://devfeed.tech/articles/testing-functions-with-lambdas-using-mockk-22666.md>)

Original publisher: [Read original article](<https://www.valueof.io/blog/testing-listener-lambda-mockk>)

Author: James Shvarts

Published: 2022-12-18T15:58:29Z

Content type: tutorial

Language: en

Sources: [Android Blog - Mobile Dev Notes](<https://devfeed.tech/sources/android-blog-mobile-dev-notes.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [callback](<https://devfeed.tech/tags/callback.md>), [function](<https://devfeed.tech/tags/function.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [lambda](<https://devfeed.tech/tags/lambda.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [testing](<https://devfeed.tech/tags/testing.md>), [tests](<https://devfeed.tech/tags/tests.md>), [unit-test](<https://devfeed.tech/tags/unit-test.md>)

## AI overview

A Kotlin testing tutorial showing how to use MockK to test functions that accept success and failure lambda callbacks. It demonstrates mocking the engine, capturing or invoking callback arguments, and verifying the resulting instrument-panel behavior.

## Source excerpt

Testing Kotlin lambda invocations with MockK