---
title: "Discussion on \"How to Use Test Mocks and Fixtures In Clojure\" | Hashnode"
description: "Discussion on \"How to Use Test Mocks and Fixtures In Clojure\". After we've learned unit testing, at some point, the complexity of the software grows enough for us to reach out to mock functions and set up test fixtures. Mocks are often needed when you have external services that are unavailable under your contro..."
url: "https://hashnode.com/posts/how-to-use-test-mocks-and-fixtures-in-clojure/667e620bcd55741f9c0ab8f7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Use Test Mocks and Fixtures In Clojure](https://tonitalksdev.com/how-to-use-test-mocks-and-fixtures-in-clojure?utm_source=hashnode&utm_medium=feed)

After we've learned unit testing, at some point, the complexity of the software grows enough for us to reach out to mock functions and set up test fixtures. Mocks are often needed when you have external services that are unavailable under your contro...

Jun 28, 2024 · 6 min read · tonitalksdev.com  
Read the article

-   [#clojure](https://hashnode.com/tag/clojure)
-   [#testing](https://hashnode.com/tag/testing)
-   [#tdd](https://hashnode.com/tag/tdd)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Toni Väisänen](https://hashnode.com/@tvaisanen)

@tvaisanen · Oulu, FI

  
[View profile](https://hashnode.com/@tvaisanen)

Consultant | Fullstack Developer | ML Engineer

Software engineer @ Metosin Ltd Need help with a project, contact: first.last@metosin.com As a 𝐜𝐨𝐧𝐬𝐮𝐥𝐭𝐚𝐧𝐭, I help clients find technical solutions to their business problems and facilitate communication between the stakeholders and the technical team. As a 𝐟𝐮𝐥𝐥-𝐬𝐭𝐚𝐜𝐤 𝐝𝐞𝐯𝐞𝐥𝐨𝐩𝐞𝐫, I build technical solutions for client's problems from user interfaces, and backend services to infrastructure-as-code solutions. As a 𝐦𝐚𝐜𝐡𝐢𝐧𝐞 𝐥𝐞𝐚𝐫𝐧𝐢𝐧𝐠 𝐞𝐧𝐠𝐢𝐧𝐞𝐞𝐫, I create, validate and deploy predictive models.

## Responses 1

Markdown supported · ⌘↵ to post

[Toni Väisänen](https://hashnode.com/@tvaisanen)

[Jul 3, 2024](https://hashnode.com/posts/how-to-use-test-mocks-and-fixtures-in-clojure/667e620bcd55741f9c0ab8f7/comment/6684f5d70b9cdb3604f72e31)

As Lasse pointed out in Clojurians Slack:

"It might be a good idea to mention the downsides of with-redefs, e.g. if you use a multi-threaded test runner like eftest you will most likely end up with randomly failing tests"
