Skip to content

Conversation

@paladox
Copy link
Contributor

@paladox paladox commented Nov 17, 2025

This adds support for newer nodejs versions.

Also drops support for nodejs versions less than 18.

paladox and others added 3 commits November 17, 2025 13:56
@paladox
Copy link
Contributor Author

paladox commented Nov 17, 2025

I'm not sure if test failure is due to this change but it's failing with:

FAIL nodejs-tests/compareImages.test.js (12.284 s)
  ● compareImages › Buffers data
    thrown: "Exceeded timeout of 5000 ms for a test.
    Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
       7 |
       8 | describe("compareImages", () => {
    >  9 |     test("Buffers data", async () => {
         |     ^
      10 |         const readImg1 = readFile("./demoassets/People.jpg");
      11 |         const readImg2 = readFile("./demoassets/People2.jpg");
      12 |         const readComparison = readFile("./nodejs-tests/assets/PeopleComparedToPeople2.png");
      at test (nodejs-tests/compareImages.test.js:9:5)
      at Object.describe (nodejs-tests/compareImages.test.js:8:1)
  ● compareImages › throws when failed
    expect(received).rejects.toMatch(expected)
    Expected substring: "Failed to load image 'bogus data'. Error: ENOENT, No such file or directory 'bogus data'"
    Received string:    "Failed to load image 'bogus data'. Error: No such file or directory"
      35 |     test("throws when failed", async () => {
      36 |         const promise = compareImages(fs.readFileSync("./demoassets/People.jpg"), "bogus data");
    > 37 |         await expect(promise).rejects.toMatch("Failed to load image 'bogus data'. Error: ENOENT, No such file or directory 'bogus data'");
         |                                       ^
      38 |     });
      39 |
      40 |     test("throws when invalid image format", async () => {
      at Object.toMatch (node_modules/expect/build/index.js:210:22)
      at Object.toMatch (nodejs-tests/compareImages.test.js:37:39)
PASS nodejs-tests/errorPixelTransform.test.js
FAIL nodejs-tests/resemble.test.js (14.357 s)
  ● resemble › file not found
    expect(received).toEqual(expected) // deep equality
    Expected: "Failed to load image '../demoassets/People.jpg'. Error: ENOENT, No such file or directory '../demoassets/People.jpg'"
    Received: "Failed to load image '../demoassets/People.jpg'. Error: No such file or directory"
      58 |                 .compareTo("../demoassets/404-image.jpg")
      59 |                 .onComplete((data) => {
    > 60 |                     expect(data.error).toEqual(
         |                                        ^
      61 |                         "Failed to load image '../demoassets/People.jpg'. Error: ENOENT, No such file or directory '../demoassets/People.jpg'"
      62 |                     );
      63 |                     resolve();
      at Array.toEqual (nodejs-tests/resemble.test.js:60:40)
      at triggerDataUpdate (resemble.js:224:43)
      at triggerDataUpdate (resemble.js:806:25)
      at callback (resemble.js:324:17)
      at setSource (node_modules/canvas/lib/image.js:91:13)
      at Image.set (node_modules/canvas/lib/image.js:62:9)
      at loadImageData (resemble.js:334:32)
      at loadImageData (resemble.js:831:13)
      at compare (resemble.js:958:25)
      at Object.wrapper [as onComplete] (resemble.js:961:21)
      at onComplete (nodejs-tests/resemble.test.js:59:18)
      at Object.<anonymous> (nodejs-tests/resemble.test.js:56:9)
PASS nodejs-tests/ignore.test.js (14.923 s)
Test Suites: 2 failed, 2 passed, 4 total

EdwinKempin pushed a commit to GerritCodeReview/gerrit that referenced this pull request Nov 21, 2025
It updates to this pull [0].

Updates canvas to 3.2.0 which adds support for newer nodejs versions.

[0] rsmbl/Resemble.js#233

Release-Notes: Update resemblejs to 180269c6a49be4fa8a406b1ec206b1b5e940a3c2
Change-Id: Ie62b1636effdfe5c20e316677480d4f1d529b755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant