mochajs/mocha · error · TypeError

ERR_MOCHA_INVALID_ARG_TYPE

ERR_MOCHA_INVALID_ARG_TYPE

Error message

Suite "${suite.fullTitle()}" was defined but no callback was supplied. Supply a callback or explicitly skip the suite.

What it means

Error "Suite "${suite.fullTitle()}" was defined but no callback was supplied. Supply a callback or explicitly skip the suite." thrown in mochajs/mocha.

Source

Thrown at lib/interfaces/common.js:146

        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;
      },
    },

    test: {
      /**
       * Exclusive test-case.

View on GitHub (pinned to 6bcbee4fd9)

When it happens

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

Common situations: See trigger scenarios.


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