From 14e640ee49718d587779a9594b18f3796c42cf2a Mon Sep 17 00:00:00 2001 From: Joy Dey Date: Wed, 30 Oct 2024 12:26:52 -0400 Subject: [PATCH] docs: indicate 'exports' interface does not work in browsers (#5181) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 ✨ --- docs/index.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 603e5e43cb..1eba83acfb 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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 = {