Skip to content

Tests fail on node v25.2.0 #2451

@shadowspawn

Description

@shadowspawn

As raised by nodejs/node#60677 (comment) and reproduced locally:

% node --version
v25.2.0
% npm t
...
 FAIL  tests/argument.required.test.js
  ● Test suite failed to run

    SecurityError: Cannot initialize local storage without a `--localstorage-file` path

      at new NodeEnvironment (node_modules/jest-environment-node/build/index.js:110:52)
...
Test Suites: 110 failed, 110 total

CITGM search for Commander on: https://ci.nodejs.org/job/citgm-smoker/lastCompletedBuild/testReport/

The issue is potentially triggered by jest accessing local storage. An older similar issue is: jestjs/jest#12813

A work-around of sorts (for macOS and Linux) is changing script invocation to:

    "test": "NODE_OPTIONS='--localstorage-file=./test-localstorage.db' jest && npm run check:type:ts",

But triggers a Jest warning:

● Validation Warning:

  Unknown option "nodeOptions" with value ["--localstorage-file=./test-localstorage.db"] was found.
  This is probably a typing mistake. Fixing it will remove this message.

  Configuration Documentation:
  https://jestjs.io/docs/configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions