1- import { Client , CombinedError } from "@urql/vue" ;
21import { describe , expect , it , vi } from "vitest" ;
32import type { MaybeRef } from "vue" ;
43import { ref } from "vue" ;
4+ import { Client , CombinedError } from "@urql/vue" ;
55import type { Subject } from "wonka" ;
66import { fromValue , makeSubject , never } from "wonka" ;
77
@@ -13,7 +13,7 @@ import { useInSetupWithUrqlClient } from "./setup-with-client";
1313function useQueryFromClient ( client : MaybeRef < Client > ) {
1414 const disposable = useInSetupWithUrqlClient (
1515 ( ) => useCtrlStateQuery ( { variables : { } } ) ,
16- client
16+ client ,
1717 ) ;
1818 const { ret : query } = disposable ;
1919 return { query, [ Symbol . dispose ] : ( ) => disposable [ Symbol . dispose ] ( ) } ;
@@ -47,7 +47,9 @@ describe("useCtrlStateQuery with mock client", () => {
4747 } ) ;
4848
4949 it ( "error" , async ( ) => {
50- const error = new CombinedError ( { networkError : Error ( "something went wrong!" ) } ) ;
50+ const error = new CombinedError ( {
51+ networkError : Error ( "something went wrong!" ) ,
52+ } ) ;
5153 const executeQuery = vi . fn ( ( ) => fromValue ( { error } ) ) ;
5254 const client = ref ( { executeQuery } ) ;
5355 using res = useQueryFromClient ( client as any ) ;
@@ -80,7 +82,9 @@ describe("useCtrlStateQuery with mock client", () => {
8082 } ) ;
8183
8284 it ( "error after fetching" , async ( ) => {
83- const error = new CombinedError ( { networkError : Error ( "something went wrong!" ) } ) ;
85+ const error = new CombinedError ( {
86+ networkError : Error ( "something went wrong!" ) ,
87+ } ) ;
8488 const subject : Subject < { data ?: CtrlStateQuery ; error ?: Error } > = makeSubject ( ) ;
8589 const executeQuery = vi . fn ( ( ) => subject . source ) ;
8690 const client = ref ( { executeQuery } ) ;
0 commit comments