Skip to content

Unhandled promise rejection: TypeError: response.textConverted is not a function while using Jasmine with Frisby #588

Open

Description

@mcoulont

Hello

My question is here but I kind of copy it below for the sake of readability.

I use Jasmine (in Angular) to access the server with the following test:

it("webmaster's email address", function(done) {
  frisby.setup({
    request: {
      headers: {
        'Authorization': Buffer.from(
          component.getAuthService().toString()
        ),
        'Content-Type': 'application/json',
        'Accept': 'application/json',
        'Access-Control-Allow-Origin': '*',
        'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
      }
    }
  }, true)
  .get('http://localhost:80/api/getWebmasterEmail')
  .then(function(response: any) {
    expect(response.status).toBe(200)
  })
  .done(done);
})

But Jasmine returns the following error:

Unhandled promise rejection: TypeError: response.textConverted is not a function
TypeError: response.textConverted is not a function
    at http://localhost:9876/_karma_webpack_/webpack:/node_modules/frisby/src/frisby/spec.js:145:25
...

I've run npm install encoding

Activity

  1. koooge commented on Mar 31, 2023

    @koooge
    Collaborator

    It would relate to node-fetch node-fetch/node-fetch#412

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions