aboutsummaryrefslogtreecommitdiff
path: root/packages/web-util/src/tests/swr.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/web-util/src/tests/swr.ts')
-rw-r--r--packages/web-util/src/tests/swr.ts12
1 files changed, 4 insertions, 8 deletions
diff --git a/packages/web-util/src/tests/swr.ts b/packages/web-util/src/tests/swr.ts
index 95c62ebea..62a35f83d 100644
--- a/packages/web-util/src/tests/swr.ts
+++ b/packages/web-util/src/tests/swr.ts
@@ -15,10 +15,9 @@
*/
import { ComponentChildren, FunctionalComponent, h, VNode } from "preact";
-import { MockEnvironment, Query } from "./mock.js";
+import { MockEnvironment } from "./mock.js";
import { SWRConfig } from "swr";
-export { Query };
/**
* Helper for hook that use SWR inside.
*
@@ -30,14 +29,10 @@ export class SwrMockEnvironment extends MockEnvironment {
super(debug);
}
- mockApiIfNeeded(): void {
- null; // do nothing
- }
-
public buildTestingContext(): FunctionalComponent<{
children: ComponentChildren;
}> {
- const __REGISTER_REQUEST = this.registerRequest.bind(this);
+ const __SAVE_REQUEST_AND_GET_MOCKED_RESPONSE = this.saveRequestAndGetMockedResponse.bind(this);
return function TestingContext({
children,
}: {
@@ -47,8 +42,9 @@ export class SwrMockEnvironment extends MockEnvironment {
SWRConfig,
{
value: {
+ // eslint-disable-next-line @typescript-eslint/ban-types
fetcher: (url: string, options: object) => {
- const mocked = __REGISTER_REQUEST(
+ const mocked = __SAVE_REQUEST_AND_GET_MOCKED_RESPONSE(
{
method: "get",
url,