From de9e9cadddec7cbf91ccceb27a4d49707e96450f Mon Sep 17 00:00:00 2001 From: Alan B <918773+alanb2718@users.noreply.github.com> Date: Wed, 25 Oct 2023 13:12:17 -0700 Subject: [PATCH] mollify type checker --- src/resources/js/test/loginForm.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resources/js/test/loginForm.test.tsx b/src/resources/js/test/loginForm.test.tsx index 0af4427e3..939d63066 100644 --- a/src/resources/js/test/loginForm.test.tsx +++ b/src/resources/js/test/loginForm.test.tsx @@ -1,6 +1,7 @@ import { render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { AuthenticationError, ResponseError, Token, User } from 'bmlt-root-server-client'; +import { Readable } from 'stream'; import { describe, test, vi } from 'vitest'; import App from '../App'; @@ -66,9 +67,8 @@ async function mockLogin(username: string, password: string): Promise { if (username === 'serveradmin' && password === 'good-password') { return mockAuthToken; } else { - const { Readable } = require('stream'); - const strm = Readable.from('{ "message": "The provided credentials are incorrect." }'); - const r: Response = new Response(strm, { status: 401, statusText: 'Unauthorized' }); + const strm: any = Readable.from('{ "message": "The provided credentials are incorrect." }'); + const r: Response = new Response(strm as ReadableStream, { status: 401, statusText: 'Unauthorized' }); throw new ResponseError(r, 'Response returned an error code'); } }