Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mcoulont opened this issue Mar 3, 2023 · 1 comment

Comments

@mcoulont
Copy link

mcoulont commented Mar 3, 2023

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

@koooge
Copy link
Collaborator

koooge commented Mar 31, 2023

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
Projects
None yet
Development

No branches or pull requests

2 participants