Skip to content

Get rif of AggregateError warning in tests #1118

@rolandgeider

Description

@rolandgeider

There's a bunch of errors when running the tests. These mean that we're trying to send out real requests during tests, we're probably missing something while mocking?

  console.error
    Error: AggregateError
        at Object.dispatchError (/Users/roland/Entwicklung/wger/react/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/xhr/xhr-utils.js:62:19)
        at Request.<anonymous> (/Users/roland/Entwicklung/wger/react/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/xhr/XMLHttpRequest-impl.js:655:18)
        at Request.emit (node:events:530:35)
        at ClientRequest.<anonymous> (/Users/roland/Entwicklung/wger/react/node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/living/helpers/http-request.js:127:14)
        at ClientRequest.emit (node:events:518:28)
        at emitErrorEvent (node:_http_client:104:11)
        at Socket.socketErrorListener (node:_http_client:518:5)
        at Socket.emit (node:events:518:28)
        at emitErrorNT (node:internal/streams/destroy:170:8)
        at emitErrorCloseNT (node:internal/streams/destroy:129:3)
        at processTicksAndRejections (node:internal/process/task_queues:90:21) {
      type: 'XMLHttpRequest'
    }

      at VirtualConsole.<anonymous> (node_modules/jest-environment-jsdom/node_modules/@jest/environment-jsdom-abstract/build/index.js:78:23)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions