sinonjs / sinon

Test spies, stubs and mocks for JavaScript.
https://sinonjs.org/
Other
9.67k stars 769 forks source link

Try to use newer mochify packages #2609

Closed fatso83 closed 2 months ago

fatso83 commented 3 months ago

Purpose (TL;DR) - mandatory

Fix the failure where bundling with mochify fails today:

❯ npm run test-headless

> sinon@18.0.0 test-headless
> mochify --no-detect-globals --recursive -R dot --grep WebWorker --invert  "test/**/*-test.js"

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/Users/carlerik/dev/sinon/timers'
    required by /Users/carlerik/dev/fake-timers/src/fake-timers-src.js
socket-security[bot] commented 3 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@mochify/cli@0.4.1 Transitive: environment, filesystem, network, shell +51 3.63 MB mantoni
npm/@mochify/driver-puppeteer@0.4.0 Transitive: environment, filesystem, network, shell, unsafe +152 55.5 MB mantoni
npm/@mochify/driver-webdriver@0.2.1 Transitive: environment, eval, filesystem, network, shell +177 30.4 MB mantoni
npm/@sinonjs/referee-sinon@12.0.0 Transitive: environment, eval +23 1.95 MB mantoni
npm/esbuild-plugin-istanbul@0.3.0 filesystem 0 5.85 kB abraha2d
npm/esbuild@0.23.1 None +24 241 MB esbuild, evanw
npm/get-stdin@9.0.0 None 0 4.54 kB sindresorhus
npm/sinon@17.0.1 Transitive: environment, eval +4 7 MB fatso83

🚮 Removed packages: npm/mochify@9.2.0

View full report↗︎

socket-security[bot] commented 3 months ago

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

fatso83 commented 3 months ago

This is failing differently here than locally:


Error: R] Could not resolve "./test"

    <stdin>:1:8:
      1 │ require('./test');
        ╵         ~~~~~~~~

1 error

Locally I am getting this:


✘ [ERROR] Could not resolve "timers"

    test.js:2:23:
      2 │ timersModule = require("timers");
        ╵                        ~~~~~~~~

  The package "timers" wasn't found on the file system but is built into node. Are you trying to
  bundle for node? You can use "--platform=node" to do that, which will remove this error.

✘ [ERROR] Could not resolve "timers/promises"

    test.js:7:23:
      7 │ timersModule = require("timers/promises");
        ╵                        ~~~~~~~~~~~~~~~~~

  The package "timers/promises" wasn't found on the file system but is built into node. Are you
  trying to bundle for node? You can use "--platform=node" to do that, which will remove this error.
fatso83 commented 2 months ago

I can try to extract the build bits later. This works for now!