---
title: "Discussion on \"How to write unit tests\" | Hashnode"
description: "Discussion on \"How to write unit tests\". As a beginner programmer, you often hear advice to test your code. It’s good advice—let’s look at how you can start doing it!\nWhat are unit tests\nTests are a way to explicitly set expectations about code. You establish them to allow the machine to ch..."
url: "https://hashnode.com/posts/how-to-write-unit-tests/624d5a4f375c2653317a0be0"
---

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

Discussion

# [How to write unit tests](https://how-to.dev/how-to-write-unit-tests?utm_source=hashnode&utm_medium=feed)

As a beginner programmer, you often hear advice to test your code. It’s good advice—let’s look at how you can start doing it! What are unit tests Tests are a way to explicitly set expectations about code. You establish them to allow the machine to ch...

Apr 6, 2022 · 4 min read · how-to.dev  
Read the article

-   [#beginners](https://hashnode.com/tag/beginners)
-   [#testing](https://hashnode.com/tag/testing)
-   [#tdd](https://hashnode.com/tag/tdd)
-   [#programming](https://hashnode.com/tag/programming)

## Written by

[Marcin Wosinek](https://hashnode.com/@marcin-wosinek)

@marcin-wosinek · Valencia, Spain

  
[View profile](https://hashnode.com/@marcin-wosinek)

JavaScript developer

I'm JS developer with 13 years of professional experience. I'm always happy to teach my craft.

## Responses 1

Markdown supported · ⌘↵ to post

[Carlos Powell](https://hashnode.com/@carlos503)

[Apr 6, 2022](https://hashnode.com/posts/how-to-write-unit-tests/624d5a4f375c2653317a0be0/comment/624de999375c2653317a1eed)

Very informative. Thanks for writing. 👏
