Skip to content

[fix] bug based on node versionΒ #840

Open
@HongChaeMin

Description

@HongChaeMin

Describe the bug

Node.js version: v22.1.0

OS version: MacOS Sonoma 14.4.1(23E224)

Description: From node 22 version, Array.isArray has been deprecated (https://nodejs.org/api/deprecations.html)

request(app.getHttpServer())
    .post(router)
    .set('Content-Type', 'multipart/form-data')
    .field('country', data.country)
    .field('businessLocation', data.businessLocation)
    .attach('file', 'test/resources/image.png')
    .expect(HttpStatus.CREATED)
    .expect(({ body }) => {
        expect(body).toBeDefined();
    });
(node:13214) [DEP0044] DeprecationWarning: The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.
(Use `node --trace-deprecation ...` to show where the warning was created)

When you run code on Webstorm, get the above log and when you run it on cli, get the log Aborted.
Maybe using isArrayinside the field and attach functions.

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions