From 96c22e20afad032aeec826291dc14fad9e914ccf Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Thu, 21 Nov 2019 09:23:50 +0800 Subject: [PATCH] Fix TypeScript errors --- resources/assets/tests/views/skinlib/Upload.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/assets/tests/views/skinlib/Upload.test.ts b/resources/assets/tests/views/skinlib/Upload.test.ts index 6edcd28f..fda3ec92 100644 --- a/resources/assets/tests/views/skinlib/Upload.test.ts +++ b/resources/assets/tests/views/skinlib/Upload.test.ts @@ -69,7 +69,7 @@ test('display score cost', () => { test('process input file', () => { window.URL.createObjectURL = jest.fn().mockReturnValue('file-url') - ;(window as Window & { Image: jest.Mock }).Image = jest.fn() + ;(window as Window & typeof globalThis & { Image: jest.Mock }).Image = jest.fn() .mockImplementationOnce(function (this: HTMLImageElement) { this.src = '' this.onload = null @@ -116,11 +116,11 @@ test('process input file', () => { expect(wrapper.vm.texture).toBe('file-url') - ;(window as Window & { Image: jest.Mock }).Image.mockRestore() + ;(window as Window & typeof globalThis & { Image: jest.Mock }).Image.mockRestore() }) test('upload file', async () => { - (window as Window & { Request: jest.Mock }).Request = jest.fn() + (window as Window & typeof globalThis & { Request: jest.Mock }).Request = jest.fn() Vue.prototype.$http.post .mockResolvedValueOnce({ code: 1, message: '1' }) .mockResolvedValueOnce({