Tests refactored
This commit is contained in:
13
tests/commonUtils.ts
Normal file
13
tests/commonUtils.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { MockResponseInit } from "jest-fetch-mock";
|
||||
|
||||
export const htmlRes = (translation: string, className = "result-container") => `
|
||||
<div>
|
||||
<div class=${className}>
|
||||
${translation}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
export const resolveFetchWith = (params: string | MockResponseInit) => (
|
||||
fetchMock.mockResponseOnce(async () => params)
|
||||
);
|
||||
Reference in New Issue
Block a user