Skip to content

Commit

Permalink
docs: indicate 'exports' interface does not work in browsers (#5181)
Browse files Browse the repository at this point in the history
* docs: indicate 'exports' interface does not work in browsers

* docs: move 'exports' interface browser compatibility note to the exports section

* docs: remove redundant 'exports' interface note from API.md

* Apply suggestions from code review

* Update docs/index.md

---------

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
  • Loading branch information
deyjoy and JoshuaKGoldberg authored Oct 30, 2024
1 parent 881e3b0 commit 14e640e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,11 @@ suite('Array', function () {

### Exports

The **Exports** interface is much like Mocha's predecessor [expresso][]. The keys `before`, `after`, `beforeEach`, and `afterEach` are special-cased, object values are suites, and function values are test-cases:
The **Exports** interface allows for organizing tests in a modular fashion. It is particularly useful in larger projects where test suites can be segmented into different files.

**Note**: The Exports interface is not supported in browser environments. This limitation arises because browsers handle module exports differently from Node.js. If you intend to run tests in a browser, consider using the BDD or TDD interfaces, which are fully supported.

The Exports interface is much like Mocha's predecessor [expresso][]. The keys `before`, `after`, `beforeEach`, and `afterEach` are special-cased, object values are suites, and function values are test-cases:

```js
module.exports = {
Expand Down

0 comments on commit 14e640e

Please # to comment.