mochajs/mocha · error · Error

ERR_MOCHA_UNSUPPORTED

ERR_MOCHA_UNSUPPORTED

Error message

Pending test forbidden

What it means

Error "Pending test forbidden" thrown in mochajs/mocha.

Source

Thrown at lib/interfaces/common.js:140

       * @param {boolean} [opts.pending] Is Suite pending?
       * @param {string} [opts.file] Filepath where this Suite resides
       * @param {boolean} [opts.isOnly] Is Suite exclusive?
       * @returns {Suite}
       */
      create: function create(opts) {
        var suite = Suite.create(suites[0], opts.title);
        suite.pending = Boolean(opts.pending);
        suite.file = opts.file;
        suites.unshift(suite);
        if (opts.isOnly) {
          suite.markOnly();
        }
        if (
          suite.pending &&
          mocha.options.forbidPending &&
          shouldBeTested(suite)
        ) {
          throw createUnsupportedError("Pending test forbidden");
        }
        if (typeof opts.fn === "function") {
          opts.fn.call(suite);
          suites.shift();
        } else if (typeof opts.fn === "undefined" && !suite.pending) {
          throw createMissingArgumentError(
            'Suite "' +
              suite.fullTitle() +
              '" was defined but no callback was supplied. ' +
              "Supply a callback or explicitly skip the suite.",
            "callback",
            "function",
          );
        } else if (!opts.fn && suite.pending) {
          suites.shift();
        }

        return suite;

View on GitHub (pinned to 6bcbee4fd9)

When it happens

Trigger: Thrown at lib/interfaces/common.js:140 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of mochajs/mocha@6bcbee4fd9 (2026-09-01). Data as JSON: /api/errors/96e080def0584827. Report an issue: GitHub.