Skip to content

Commit

Permalink
mollify type checker
Browse files Browse the repository at this point in the history
  • Loading branch information
alanb2718 committed Oct 25, 2023
1 parent 08a5891 commit de9e9ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/resources/js/test/loginForm.test.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -66,9 +67,8 @@ async function mockLogin(username: string, password: string): Promise<Token> {
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');
}
}
Expand Down

0 comments on commit de9e9ca

Please sign in to comment.