3

I am trying to get my unit test working. It currently fails with:

TypeError: URL.createObjectURL is not a function

I eventually stumble upon:

So I am now providing the following mock:

  test('my test', async (): Promise<void> => {
    window.URL.createObjectURL = (object: any): string => object.toString();

However this makes eslint reports now:

Avoid referencing unbound methods which may cause unintentional scoping of `this`.

Even after reading twice:

It feels like (object: any): string => object.toString() is correct here. What am I missing / misunderstanding ?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.