Skip to content

Commit

Permalink
docs: indicate 'exports' interface does not work in browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
deyjoy committed Jul 23, 2024
1 parent 9692b3a commit bcdd857
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Congratulations! You've found Mocha's API documentation. These docs are for deve

Otherwise, **you probably want the [main documentation](https://mochajs.org)**.

## Exports Interface

The "exports" interface is useful for organizing tests in a modular fashion. However, please note that the "exports" interface is **not supported in browser environments**. This is due to the way browsers handle module exports, which differs from Node.js. If you need to organize your tests for a large OOP project, consider using the BDD or TDD interfaces instead.

## Other Links

- **[Main Documentation](https://mochajs.org)**
Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Mocha is a feature-rich JavaScript test framework running on [Node.js][] and in
- [TextMate bundle](#textmate)
{:.two-column}

## Running Mocha

Mocha can be run in various environments, including Node.js and browsers. While most interfaces such as BDD and TDD are fully supported, please note that the "exports" interface does not work in browser environments due to how browsers handle module exports. Refer to the [Interfaces](./API.md#exports-interface) and [Browser Support](./browser-support.md) documentation for more details.

## Table of Contents

{{ toc }}
Expand Down

0 comments on commit bcdd857

Please sign in to comment.