---
title: "Discussion on \"Mocha Testing in Separate Files and Dotenv\" | Hashnode"
description: "Discussion on \"Mocha Testing in Separate Files and Dotenv\". Introduction\nThe main goal of dividing tests into multiple files is to make tests readable and easier to maintain. Each file should be responsible for a single responsibility. Here is how I separate tests into multiple files:\nStep by step\nFirst, we n..."
url: "https://hashnode.com/posts/mocha-testing-in-separate-files-and-dotenv/6315a963041b51e1712e729c"
---

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

Discussion

# [Mocha Testing in Separate Files and Dotenv](https://hermansyah.dev/mocha-testing-in-separate-files-and-dotenv?utm_source=hashnode&utm_medium=feed)

Introduction The main goal of dividing tests into multiple files is to make tests readable and easier to maintain. Each file should be responsible for a single responsibility. Here is how I separate tests into multiple files: Step by step First, we n...

Sep 5, 2022 · 5 min read · hermansyah.dev  
Read the article

-   [#mocha](https://hashnode.com/tag/mocha)
-   [#testing](https://hashnode.com/tag/testing)
-   [#nodejs](https://hashnode.com/tag/nodejs)

## Written by

[Hermansyah](https://hashnode.com/@hermansyah32)

@hermansyah32 · Indonesia

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

Freelance Software Develoepr

On the way become backend developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
