Audience
DevOps teams looking for a Unit Testing solution
About MockK
Mocking is a technique to make testing code readable and maintainable. In three consequent articles, I would like to show the basics, features, and quirks of the MockK library. It is a new open-source library (github repository) focused on making mocking in Kotlin great. Injection first tries to match properties by name, then by class or superclass. Check the lookupType parameter for customization. Properties are injected even if private is applied. Constructors for injection are selected from the biggest number of arguments to lowest.
Popular Alternatives
PowerMock
Writing unit tests can be hard and sometimes good design has to be sacrificed for the sole purpose of testability. Often testability corresponds to good design, but this is not always the case. For example final classes and methods cannot be used, private methods sometimes need to be protected or unnecessarily moved to a collaborator, static methods should be avoided completely and so on simply because of the limitations of existing frameworks. PowerMock is a framework that extends other mock libraries such as EasyMock with more powerful capabilities. PowerMock uses a custom classloader and bytecode manipulation to enable mocking of static methods, constructors, final classes and methods, private methods, removal of static initializers and more. By using a custom classloader no changes need to be done to the IDE or continuous integration servers which simplifies adoption.
Learn more
Catch2
Catch2 is mainly a unit testing framework for C++, but it also provides basic micro-benchmarking features and simple BDD macros. Catch2's main advantage is that using it is both simple and natural. Test names do not have to be valid identifiers, assertions look like normal C++ boolean expressions, and sections provide a nice and local way to share set-up and tear-down code in tests. You are on the devel branch, where the v3 version is being developed. v3 brings a bunch of significant changes, the big one being that Catch2 is no longer a single-header library. Catch2 now behaves as a normal library, with multiple headers and separately compiled implementation. Quick and easy to get started. Just download two files, add them to your project and you're away. No external dependencies. As long as you can compile C++14 and have the C++ standard library available. Write test cases as, self-registering, functions (or methods, if you prefer).
Learn more
Mockito
Mockito is a mocking framework that tastes really good. It lets you write beautiful tests with a clean & simple API. Mockito doesn’t give you hangover because the tests are very readable and they produce clean verification errors. Read more about features & motivations. Top 10 Java library across all libraries, not only the testing tools. In late 2013 there was an analysis made of 30.000 GitHub projects. Although Mockito reached number 9 in the main report, mockito-core and mockito-all are the same tool and therefore the factual position of Mockito is number 4, surpassing famous tools like Guava or Spring. Treat this study as an indicator of a big impact that Mockito makes every day on unit tests written in Java.
Learn more
Cypress
Fast, easy and reliable end-to-end testing for anything that runs in a browser. Cypress has been made specifically for developers and QA engineers, to help them get more done. Cypress benefits from our amazing open-source community - and our tools are evolving better and faster than if we worked on them alone. Cypress is based on a completely new architecture. No more Selenium. Lots more power. Cypress takes snapshots as your tests run. Simply hover over commands in the Command Log to see exactly what happened at each step. Stop guessing why your tests are failing. Debug directly from familiar tools like Chrome DevTools. Our readable errors and stack traces make debugging lightning fast. Cypress automatically reloads whenever you make changes to your tests. See commands execute in real-time in your app. Never add waits or sleeps to your tests. Cypress automatically waits for commands and assertions before moving on. No more async hell.
Learn more
Pricing
Starting Price:
Free
Free Version:
Free Version available.
Company Information
MockK
mockk.io
You Might Also Like
Our Free Plans just got better! | Auth0 by Okta
You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your secuirty. Auth0 now, thank yourself later.
Product Details
Platforms Supported
Windows
Mac
Linux
Training
Documentation
Support
Online