Skip to content

馃悰 Bug: spec file starting with a number rejected#6221

Description

@grahamrhay

Bug Report Checklist

Expected

passing tests

Actual

after dependabot bumped mocha from ~10.8.1 to ~11.7.6, tests started failing with this error:

npx mocha 1***.js
/app/node_modules/mocha/lib/cli/options.js:139
    throw createUnsupportedError(
    ^

Error: Option 1***.js is unsupported by the mocha cli
    at createUnsupportedError (/app/node_modules/mocha/lib/errors.js:126:13)
    at createErrorForNumericPositionalArg (/app/node_modules/mocha/lib/cli/options.js:139:11)
    at parse (/app/node_modules/mocha/lib/cli/options.js:190:5)
    at loadOptions (/app/node_modules/mocha/lib/cli/options.js:291:14)
    at Object.<anonymous> (/app/node_modules/mocha/bin/mocha.js:29:14)
    at Module._compile (node:internal/modules/cjs/loader:1781:14)
    at Object..js (node:internal/modules/cjs/loader:1913:10)
    at Module.load (node:internal/modules/cjs/loader:1505:32)
    at Function._load (node:internal/modules/cjs/loader:1309:12)
    at wrapModuleLoad (node:internal/modules/cjs/loader:254:19) {
  code: 'ERR_MOCHA_UNSUPPORTED'
}

other spec files (not starting with a number) work fine. is this a bug, or were we using something unsupported that just happened to work until now?

#5263

this, perhaps?

Minimal, Complete and Verifiable Example

create a spec in a filename starting with a number, try and run it

Versions

see above

Additional Info

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    major: v11status: in triagea maintainer should (re-)triage (review) this issuetype: buga defect, confirmed by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions