Skip to content

Unable to mock for test #102

@ergunp

Description

@ergunp

Hi,

I am trying to mock adalFetch but with no luck. I keep getting,
{ message: 'User login is required', msg: 'login required' }
here is what I have so far

  jest.mock('./../config/adal-config', () => ({
            authContext: () => jest.fn(),
            getToken: () => jest.fn(),
            adalApiFetch: () => Promise.resolve({ json: () => mockedReturnedData }), 
            adalFetch: () => jest.fn() 
          }));

Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions