Skip to content

Unable to run unit tests on MacOS 15.6.1 #1209

Open

Description

@pRatikSathaye

I am using following versions of deps for my project

  1. bcrypt: 6.0.0
  2. Node: 20.19.1
  3. npm: 10.8.2

I am trying to run a unit test as follows

    it('returns true if password and hash match', async () => {
      const password = uuid();
      const passwordHash = await hash(password);

      expect(await compare(password, passwordHash)).to.be.equal(true);
    });

The test fails with following error

     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/<path-to-repo>/test/new-unit/common/bcrypt.test.js)
      at listOnTimeout (node:internal/timers:581:17)
      at process.processTimers (node:internal/timers:519:7)

What I found is that the node_modules/bcrypt does not contains the compatible version of bcrypt.node for MacOS 15.6.1. Unfortunately I do not have MacOS 16 version so I was unable to test this.

Note: When I tried updating timeout to 5s, the test runs successully

Can someone help?

Activity

  1. recrsn commented on Oct 14, 2025

    @recrsn
    Collaborator

    You have something (security software?) causing slowness, test do work on a M1 MacBook Pro running macOS Sequoia

  2. sushithegreat commented on Oct 15, 2025

    @sushithegreat

    I suspect it may have something to do with the prebuilt binary. If I go into the bcrypt directory in node_modules and run npm i && npm run build it'll execute prebuildify --napi --tag-libc --strip, which then creates a new binary at bcrypt/prebuilds/darwin-arm64/bcrypt.glibc.node. Running the unit test with the new binary and no other changes works.

  3. pRatikSathaye commented on Oct 29, 2025

    @pRatikSathaye
    Author

    Any thoughts on this? @recrsn

    I suspect it may have something to do with the prebuilt binary. If I go into the bcrypt directory in node_modules and run npm i && npm run build it'll execute prebuildify --napi --tag-libc --strip, which then creates a new binary at bcrypt/prebuilds/darwin-arm64/bcrypt.glibc.node. Running the unit test with the new binary and no other changes works.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions