---
description: The require interface for Mocha.
title: Require
---

The `require` interface allows you to require the `describe` and friend words directly using `require` and call them whatever you want.
This interface is also useful if you want to avoid global variables in your tests.

:::note
The `require` interface cannot be run via the `node` executable, and must be run via `mocha`.
:::

```js
import { describe as testCase, before as pre, it as assertions } from "mocha";
import { assert } from "chai";

testCase("Array", function () {
  pre(function () {
    // ...
  });

  testCase("#indexOf()", function () {
    assertions("should return -1 when not present", function () {
      assert.equal([1, 2, 3].indexOf(4), -1);
    });
  });
});
```
