@apollo/client 3.8.3 → 3.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +8 -6
  2. package/apollo-client.cjs +57 -73
  3. package/apollo-client.cjs.map +1 -1
  4. package/apollo-client.min.cjs +1 -1
  5. package/config/jest/setup.js +10 -0
  6. package/config/jest/setup.js.map +1 -1
  7. package/core/ObservableQuery.d.ts.map +1 -1
  8. package/core/ObservableQuery.js +5 -6
  9. package/core/ObservableQuery.js.map +1 -1
  10. package/core/QueryInfo.d.ts +0 -2
  11. package/core/QueryInfo.d.ts.map +1 -1
  12. package/core/QueryInfo.js +0 -2
  13. package/core/QueryInfo.js.map +1 -1
  14. package/core/QueryManager.d.ts +1 -1
  15. package/core/QueryManager.d.ts.map +1 -1
  16. package/core/QueryManager.js +2 -2
  17. package/core/QueryManager.js.map +1 -1
  18. package/core/core.cjs +8 -11
  19. package/core/core.cjs.map +1 -1
  20. package/core/core.cjs.native.js +8 -11
  21. package/dev/dev.cjs +30 -16
  22. package/dev/dev.cjs.map +1 -1
  23. package/dev/dev.cjs.native.js +30 -16
  24. package/dev/loadErrorMessageHandler.js +1 -1
  25. package/dev/loadErrorMessageHandler.js.map +1 -1
  26. package/package.json +30 -23
  27. package/react/cache/index.d.ts +0 -4
  28. package/react/cache/index.d.ts.map +1 -1
  29. package/react/cache/index.js +0 -14
  30. package/react/cache/index.js.map +1 -1
  31. package/react/index.d.ts +0 -1
  32. package/react/index.d.ts.map +1 -1
  33. package/react/index.js +0 -1
  34. package/react/index.js.map +1 -1
  35. package/react/react.cjs +1 -218
  36. package/react/react.cjs.map +1 -1
  37. package/react/react.cjs.native.js +1 -218
  38. package/react/types/types.d.ts +0 -3
  39. package/react/types/types.d.ts.map +1 -1
  40. package/react/types/types.js.map +1 -1
  41. package/testing/core/withConsoleSpy.d.ts.map +1 -1
  42. package/testing/core/withConsoleSpy.js.map +1 -1
  43. package/testing/internal/ObservableStream.d.ts +26 -0
  44. package/testing/internal/ObservableStream.d.ts.map +1 -0
  45. package/testing/internal/ObservableStream.js +101 -0
  46. package/testing/internal/ObservableStream.js.map +1 -0
  47. package/testing/internal/disposables/index.d.ts +3 -0
  48. package/testing/internal/disposables/index.d.ts.map +1 -0
  49. package/testing/internal/disposables/index.js +3 -0
  50. package/testing/internal/disposables/index.js.map +1 -0
  51. package/testing/internal/disposables/spyOnConsole.d.ts +10 -0
  52. package/testing/internal/disposables/spyOnConsole.d.ts.map +1 -0
  53. package/testing/internal/disposables/spyOnConsole.js +33 -0
  54. package/testing/internal/disposables/spyOnConsole.js.map +1 -0
  55. package/testing/internal/disposables/withCleanup.d.ts +3 -0
  56. package/testing/internal/disposables/withCleanup.d.ts.map +1 -0
  57. package/testing/internal/disposables/withCleanup.js +11 -0
  58. package/testing/internal/disposables/withCleanup.js.map +1 -0
  59. package/testing/internal/index.d.ts +4 -0
  60. package/testing/internal/index.d.ts.map +1 -0
  61. package/testing/internal/index.js +4 -0
  62. package/testing/internal/index.js.map +1 -0
  63. package/testing/internal/profile/Render.d.ts +140 -0
  64. package/testing/internal/profile/Render.d.ts.map +1 -0
  65. package/testing/internal/profile/Render.js +132 -0
  66. package/testing/internal/profile/Render.js.map +1 -0
  67. package/testing/internal/profile/index.d.ts +4 -0
  68. package/testing/internal/profile/index.d.ts.map +1 -0
  69. package/testing/internal/profile/index.js +2 -0
  70. package/testing/internal/profile/index.js.map +1 -0
  71. package/testing/internal/profile/profile.d.ts +55 -0
  72. package/testing/internal/profile/profile.d.ts.map +1 -0
  73. package/testing/internal/profile/profile.js +222 -0
  74. package/testing/internal/profile/profile.js.map +1 -0
  75. package/testing/internal/profile/traces.d.ts +3 -0
  76. package/testing/internal/profile/traces.d.ts.map +1 -0
  77. package/testing/internal/profile/traces.js +26 -0
  78. package/testing/internal/profile/traces.js.map +1 -0
  79. package/testing/matchers/ProfiledComponent.d.ts +8 -0
  80. package/testing/matchers/ProfiledComponent.d.ts.map +1 -0
  81. package/testing/matchers/ProfiledComponent.js +107 -0
  82. package/testing/matchers/ProfiledComponent.js.map +1 -0
  83. package/testing/matchers/index.js +3 -0
  84. package/testing/matchers/index.js.map +1 -1
  85. package/utilities/globals/globals.cjs +31 -16
  86. package/utilities/globals/globals.cjs.map +1 -1
  87. package/utilities/globals/globals.cjs.native.js +31 -16
  88. package/utilities/globals/invariantWrappers.d.ts.map +1 -1
  89. package/utilities/globals/invariantWrappers.js +30 -15
  90. package/utilities/globals/invariantWrappers.js.map +1 -1
  91. package/utilities/observables/asyncMap.d.ts.map +1 -1
  92. package/utilities/observables/asyncMap.js +17 -34
  93. package/utilities/observables/asyncMap.js.map +1 -1
  94. package/utilities/utilities.cjs +17 -34
  95. package/utilities/utilities.cjs.map +1 -1
  96. package/utilities/utilities.cjs.native.js +17 -34
  97. package/version.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/types/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from \"react\";\nimport type { DocumentNode } from \"graphql\";\nimport type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\n\nimport type {\n Observable,\n ObservableSubscription,\n} from \"../../utilities/index.js\";\nimport type { FetchResult } from \"../../link/core/index.js\";\nimport type { ApolloError } from \"../../errors/index.js\";\nimport type {\n ApolloCache,\n ApolloClient,\n DefaultContext,\n FetchPolicy,\n MutationOptions,\n NetworkStatus,\n ObservableQuery,\n OperationVariables,\n InternalRefetchQueriesInclude,\n WatchQueryOptions,\n WatchQueryFetchPolicy,\n} from \"../../core/index.js\";\nimport type { SuspenseCache } from \"../cache/index.js\";\n\n/* QueryReference type */\n\nexport type { QueryReference } from \"../cache/QueryReference.js\";\n\n/* Common types */\n\nexport type { DefaultContext as Context } from \"../../core/index.js\";\n\nexport type CommonOptions<TOptions> = TOptions & {\n client?: ApolloClient<object>;\n};\n\n/* Query types */\n\nexport interface BaseQueryOptions<\n TVariables extends OperationVariables = OperationVariables,\n> extends Omit<WatchQueryOptions<TVariables>, \"query\"> {\n ssr?: boolean;\n client?: ApolloClient<any>;\n context?: DefaultContext;\n}\n\nexport interface QueryFunctionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseQueryOptions<TVariables> {\n skip?: boolean;\n onCompleted?: (data: TData) => void;\n onError?: (error: ApolloError) => void;\n\n // Default WatchQueryOptions for this useQuery, providing initial values for\n // unspecified options, superseding client.defaultOptions.watchQuery (option\n // by option, not whole), but never overriding options previously passed to\n // useQuery (or options added/modified later by other means).\n // TODO What about about default values that are expensive to evaluate?\n defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;\n}\n\nexport type ObservableQueryFields<\n TData,\n TVariables extends OperationVariables,\n> = Pick<\n ObservableQuery<TData, TVariables>,\n | \"startPolling\"\n | \"stopPolling\"\n | \"subscribeToMore\"\n | \"updateQuery\"\n | \"refetch\"\n | \"reobserve\"\n | \"variables\"\n | \"fetchMore\"\n>;\n\nexport interface QueryResult<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends ObservableQueryFields<TData, TVariables> {\n client: ApolloClient<any>;\n observable: ObservableQuery<TData, TVariables>;\n data: TData | undefined;\n previousData?: TData;\n error?: ApolloError;\n loading: boolean;\n networkStatus: NetworkStatus;\n called: boolean;\n}\n\nexport interface QueryDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends QueryFunctionOptions<TData, TVariables> {\n children?: (result: QueryResult<TData, TVariables>) => ReactNode;\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface QueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends QueryFunctionOptions<TData, TVariables> {}\n\nexport interface LazyQueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends Omit<QueryHookOptions<TData, TVariables>, \"skip\"> {}\n\nexport interface LazyQueryHookExecOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends LazyQueryHookOptions<TData, TVariables> {\n query?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport type SuspenseQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface SuspenseQueryHookOptions<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> extends Pick<\n QueryHookOptions<TData, TVariables>,\n | \"client\"\n | \"variables\"\n | \"errorPolicy\"\n | \"context\"\n | \"canonizeResults\"\n | \"returnPartialData\"\n | \"refetchWritePolicy\"\n > {\n fetchPolicy?: SuspenseQueryHookFetchPolicy;\n suspenseCache?: SuspenseCache;\n queryKey?: string | number | any[];\n\n /**\n * If `true`, the query is not executed. The default value is `false`.\n *\n * @deprecated We recommend using `skipToken` in place of the `skip` option as\n * it is more type-safe.\n *\n * @example Recommended usage of `skipToken`:\n * ```ts\n * import { skipToken, useSuspenseQuery } from '@apollo/client';\n *\n * const { data } = useSuspenseQuery(query, id ? { variables: { id } } : skipToken);\n * ```\n */\n skip?: boolean;\n}\n\nexport type BackgroundQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface BackgroundQueryHookOptions<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> extends Pick<\n QueryHookOptions<TData, TVariables>,\n | \"client\"\n | \"variables\"\n | \"errorPolicy\"\n | \"context\"\n | \"canonizeResults\"\n | \"returnPartialData\"\n | \"refetchWritePolicy\"\n > {\n fetchPolicy?: BackgroundQueryHookFetchPolicy;\n suspenseCache?: SuspenseCache;\n queryKey?: string | number | any[];\n\n /**\n * If `true`, the query is not executed. The default value is `false`.\n *\n * @deprecated We recommend using `skipToken` in place of the `skip` option as\n * it is more type-safe.\n *\n * @example Recommended usage of `skipToken`:\n * ```ts\n * import { skipToken, useBackgroundQuery } from '@apollo/client';\n *\n * const [queryRef] = useBackgroundQuery(query, id ? { variables: { id } } : skipToken);\n * ```\n */\n skip?: boolean;\n}\n\n/**\n * @deprecated TODO Delete this unused interface.\n */\nexport interface QueryLazyOptions<TVariables> {\n variables?: TVariables;\n context?: DefaultContext;\n}\n\n/**\n * @deprecated TODO Delete this unused type alias.\n */\nexport type LazyQueryResult<\n TData,\n TVariables extends OperationVariables,\n> = QueryResult<TData, TVariables>;\n\n/**\n * @deprecated TODO Delete this unused type alias.\n */\nexport type QueryTuple<\n TData,\n TVariables extends OperationVariables,\n> = LazyQueryResultTuple<TData, TVariables>;\n\nexport type LazyQueryExecFunction<\n TData,\n TVariables extends OperationVariables,\n> = (\n options?: Partial<LazyQueryHookExecOptions<TData, TVariables>>\n) => Promise<QueryResult<TData, TVariables>>;\n\nexport type LazyQueryResultTuple<\n TData,\n TVariables extends OperationVariables,\n> = [LazyQueryExecFunction<TData, TVariables>, QueryResult<TData, TVariables>];\n\n/* Mutation types */\n\nexport type RefetchQueriesFunction = (\n ...args: any[]\n) => InternalRefetchQueriesInclude;\n\nexport interface BaseMutationOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends Omit<\n MutationOptions<TData, TVariables, TContext, TCache>,\n \"mutation\"\n > {\n client?: ApolloClient<object>;\n notifyOnNetworkStatusChange?: boolean;\n onCompleted?: (data: TData, clientOptions?: BaseMutationOptions) => void;\n onError?: (error: ApolloError, clientOptions?: BaseMutationOptions) => void;\n ignoreResults?: boolean;\n}\n\nexport interface MutationFunctionOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationResult<TData = any> {\n data?: TData | null;\n error?: ApolloError;\n loading: boolean;\n called: boolean;\n client: ApolloClient<object>;\n reset(): void;\n}\n\nexport declare type MutationFunction<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n) => Promise<FetchResult<TData>>;\n\nexport interface MutationHookOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {}\n\nexport interface MutationDataOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport type MutationTuple<\n TData,\n TVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = [\n (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n // TODO This FetchResult<TData> seems strange here, as opposed to an\n // ApolloQueryResult<TData>\n ) => Promise<FetchResult<TData>>,\n MutationResult<TData>,\n];\n\n/* Subscription types */\n\nexport interface OnDataOptions<TData = any> {\n client: ApolloClient<object>;\n data: SubscriptionResult<TData>;\n}\n\nexport interface OnSubscriptionDataOptions<TData = any> {\n client: ApolloClient<object>;\n subscriptionData: SubscriptionResult<TData>;\n}\n\nexport interface BaseSubscriptionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> {\n variables?: TVariables;\n fetchPolicy?: FetchPolicy;\n shouldResubscribe?:\n | boolean\n | ((options: BaseSubscriptionOptions<TData, TVariables>) => boolean);\n client?: ApolloClient<object>;\n skip?: boolean;\n context?: DefaultContext;\n onComplete?: () => void;\n onData?: (options: OnDataOptions<TData>) => any;\n /**\n * @deprecated Use onData instead\n */\n onSubscriptionData?: (options: OnSubscriptionDataOptions<TData>) => any;\n onError?: (error: ApolloError) => void;\n /**\n * @deprecated Use onComplete instead\n */\n onSubscriptionComplete?: () => void;\n}\n\nexport interface SubscriptionResult<TData = any, TVariables = any> {\n loading: boolean;\n data?: TData;\n error?: ApolloError;\n // This was added by the legacy useSubscription type, and is tested in unit\n // tests, but probably shouldn’t be added to the result.\n variables?: TVariables;\n}\n\nexport interface SubscriptionHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {}\n\nexport interface SubscriptionDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);\n}\n\nexport interface SubscriptionCurrentObservable {\n query?: Observable<any>;\n subscription?: ObservableSubscription;\n}\n\n/**\nHelper type that allows using a type in a way that cannot be \"widened\" by inference on the value it is used on.\n\nThis type was first suggested [in this Github discussion](https://github.com/microsoft/TypeScript/issues/14829#issuecomment-504042546).\n\nExample usage:\n```ts\nexport function useQuery<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: QueryHookOptions<NoInfer<TData>, NoInfer<TVariables>> = Object.create(null),\n)\n```\nIn this case, `TData` and `TVariables` should be inferred from `query`, but never widened from something in `options`.\n\nSo, in this code example:\n```ts\ndeclare const typedNode: TypedDocumentNode<{ foo: string}, { bar: number }>\nconst { variables } = useQuery(typedNode, { variables: { bar: 4, nonExistingVariable: \"string\" } });\n```\nWithout the use of `NoInfer`, `variables` would now be of the type `{ bar: number, nonExistingVariable: \"string\" }`.\nWith `NoInfer`, it will instead give an error on `nonExistingVariable`.\n */\nexport type NoInfer<T> = [T][T extends any ? 0 : never];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/react/types/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from \"react\";\nimport type { DocumentNode } from \"graphql\";\nimport type { TypedDocumentNode } from \"@graphql-typed-document-node/core\";\n\nimport type {\n Observable,\n ObservableSubscription,\n} from \"../../utilities/index.js\";\nimport type { FetchResult } from \"../../link/core/index.js\";\nimport type { ApolloError } from \"../../errors/index.js\";\nimport type {\n ApolloCache,\n ApolloClient,\n DefaultContext,\n FetchPolicy,\n MutationOptions,\n NetworkStatus,\n ObservableQuery,\n OperationVariables,\n InternalRefetchQueriesInclude,\n WatchQueryOptions,\n WatchQueryFetchPolicy,\n} from \"../../core/index.js\";\n\n/* QueryReference type */\n\nexport type { QueryReference } from \"../cache/QueryReference.js\";\n\n/* Common types */\n\nexport type { DefaultContext as Context } from \"../../core/index.js\";\n\nexport type CommonOptions<TOptions> = TOptions & {\n client?: ApolloClient<object>;\n};\n\n/* Query types */\n\nexport interface BaseQueryOptions<\n TVariables extends OperationVariables = OperationVariables,\n> extends Omit<WatchQueryOptions<TVariables>, \"query\"> {\n ssr?: boolean;\n client?: ApolloClient<any>;\n context?: DefaultContext;\n}\n\nexport interface QueryFunctionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseQueryOptions<TVariables> {\n skip?: boolean;\n onCompleted?: (data: TData) => void;\n onError?: (error: ApolloError) => void;\n\n // Default WatchQueryOptions for this useQuery, providing initial values for\n // unspecified options, superseding client.defaultOptions.watchQuery (option\n // by option, not whole), but never overriding options previously passed to\n // useQuery (or options added/modified later by other means).\n // TODO What about about default values that are expensive to evaluate?\n defaultOptions?: Partial<WatchQueryOptions<TVariables, TData>>;\n}\n\nexport type ObservableQueryFields<\n TData,\n TVariables extends OperationVariables,\n> = Pick<\n ObservableQuery<TData, TVariables>,\n | \"startPolling\"\n | \"stopPolling\"\n | \"subscribeToMore\"\n | \"updateQuery\"\n | \"refetch\"\n | \"reobserve\"\n | \"variables\"\n | \"fetchMore\"\n>;\n\nexport interface QueryResult<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends ObservableQueryFields<TData, TVariables> {\n client: ApolloClient<any>;\n observable: ObservableQuery<TData, TVariables>;\n data: TData | undefined;\n previousData?: TData;\n error?: ApolloError;\n loading: boolean;\n networkStatus: NetworkStatus;\n called: boolean;\n}\n\nexport interface QueryDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends QueryFunctionOptions<TData, TVariables> {\n children?: (result: QueryResult<TData, TVariables>) => ReactNode;\n query: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface QueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends QueryFunctionOptions<TData, TVariables> {}\n\nexport interface LazyQueryHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends Omit<QueryHookOptions<TData, TVariables>, \"skip\"> {}\n\nexport interface LazyQueryHookExecOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends LazyQueryHookOptions<TData, TVariables> {\n query?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport type SuspenseQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface SuspenseQueryHookOptions<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> extends Pick<\n QueryHookOptions<TData, TVariables>,\n | \"client\"\n | \"variables\"\n | \"errorPolicy\"\n | \"context\"\n | \"canonizeResults\"\n | \"returnPartialData\"\n | \"refetchWritePolicy\"\n > {\n fetchPolicy?: SuspenseQueryHookFetchPolicy;\n queryKey?: string | number | any[];\n\n /**\n * If `true`, the query is not executed. The default value is `false`.\n *\n * @deprecated We recommend using `skipToken` in place of the `skip` option as\n * it is more type-safe.\n *\n * @example Recommended usage of `skipToken`:\n * ```ts\n * import { skipToken, useSuspenseQuery } from '@apollo/client';\n *\n * const { data } = useSuspenseQuery(query, id ? { variables: { id } } : skipToken);\n * ```\n */\n skip?: boolean;\n}\n\nexport type BackgroundQueryHookFetchPolicy = Extract<\n WatchQueryFetchPolicy,\n \"cache-first\" | \"network-only\" | \"no-cache\" | \"cache-and-network\"\n>;\n\nexport interface BackgroundQueryHookOptions<\n TData = unknown,\n TVariables extends OperationVariables = OperationVariables,\n> extends Pick<\n QueryHookOptions<TData, TVariables>,\n | \"client\"\n | \"variables\"\n | \"errorPolicy\"\n | \"context\"\n | \"canonizeResults\"\n | \"returnPartialData\"\n | \"refetchWritePolicy\"\n > {\n fetchPolicy?: BackgroundQueryHookFetchPolicy;\n queryKey?: string | number | any[];\n\n /**\n * If `true`, the query is not executed. The default value is `false`.\n *\n * @deprecated We recommend using `skipToken` in place of the `skip` option as\n * it is more type-safe.\n *\n * @example Recommended usage of `skipToken`:\n * ```ts\n * import { skipToken, useBackgroundQuery } from '@apollo/client';\n *\n * const [queryRef] = useBackgroundQuery(query, id ? { variables: { id } } : skipToken);\n * ```\n */\n skip?: boolean;\n}\n\n/**\n * @deprecated TODO Delete this unused interface.\n */\nexport interface QueryLazyOptions<TVariables> {\n variables?: TVariables;\n context?: DefaultContext;\n}\n\n/**\n * @deprecated TODO Delete this unused type alias.\n */\nexport type LazyQueryResult<\n TData,\n TVariables extends OperationVariables,\n> = QueryResult<TData, TVariables>;\n\n/**\n * @deprecated TODO Delete this unused type alias.\n */\nexport type QueryTuple<\n TData,\n TVariables extends OperationVariables,\n> = LazyQueryResultTuple<TData, TVariables>;\n\nexport type LazyQueryExecFunction<\n TData,\n TVariables extends OperationVariables,\n> = (\n options?: Partial<LazyQueryHookExecOptions<TData, TVariables>>\n) => Promise<QueryResult<TData, TVariables>>;\n\nexport type LazyQueryResultTuple<\n TData,\n TVariables extends OperationVariables,\n> = [LazyQueryExecFunction<TData, TVariables>, QueryResult<TData, TVariables>];\n\n/* Mutation types */\n\nexport type RefetchQueriesFunction = (\n ...args: any[]\n) => InternalRefetchQueriesInclude;\n\nexport interface BaseMutationOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends Omit<\n MutationOptions<TData, TVariables, TContext, TCache>,\n \"mutation\"\n > {\n client?: ApolloClient<object>;\n notifyOnNetworkStatusChange?: boolean;\n onCompleted?: (data: TData, clientOptions?: BaseMutationOptions) => void;\n onError?: (error: ApolloError, clientOptions?: BaseMutationOptions) => void;\n ignoreResults?: boolean;\n}\n\nexport interface MutationFunctionOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport interface MutationResult<TData = any> {\n data?: TData | null;\n error?: ApolloError;\n loading: boolean;\n called: boolean;\n client: ApolloClient<object>;\n reset(): void;\n}\n\nexport declare type MutationFunction<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n) => Promise<FetchResult<TData>>;\n\nexport interface MutationHookOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {}\n\nexport interface MutationDataOptions<\n TData = any,\n TVariables = OperationVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {\n mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;\n}\n\nexport type MutationTuple<\n TData,\n TVariables,\n TContext = DefaultContext,\n TCache extends ApolloCache<any> = ApolloCache<any>,\n> = [\n (\n options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>\n // TODO This FetchResult<TData> seems strange here, as opposed to an\n // ApolloQueryResult<TData>\n ) => Promise<FetchResult<TData>>,\n MutationResult<TData>,\n];\n\n/* Subscription types */\n\nexport interface OnDataOptions<TData = any> {\n client: ApolloClient<object>;\n data: SubscriptionResult<TData>;\n}\n\nexport interface OnSubscriptionDataOptions<TData = any> {\n client: ApolloClient<object>;\n subscriptionData: SubscriptionResult<TData>;\n}\n\nexport interface BaseSubscriptionOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> {\n variables?: TVariables;\n fetchPolicy?: FetchPolicy;\n shouldResubscribe?:\n | boolean\n | ((options: BaseSubscriptionOptions<TData, TVariables>) => boolean);\n client?: ApolloClient<object>;\n skip?: boolean;\n context?: DefaultContext;\n onComplete?: () => void;\n onData?: (options: OnDataOptions<TData>) => any;\n /**\n * @deprecated Use onData instead\n */\n onSubscriptionData?: (options: OnSubscriptionDataOptions<TData>) => any;\n onError?: (error: ApolloError) => void;\n /**\n * @deprecated Use onComplete instead\n */\n onSubscriptionComplete?: () => void;\n}\n\nexport interface SubscriptionResult<TData = any, TVariables = any> {\n loading: boolean;\n data?: TData;\n error?: ApolloError;\n // This was added by the legacy useSubscription type, and is tested in unit\n // tests, but probably shouldn’t be added to the result.\n variables?: TVariables;\n}\n\nexport interface SubscriptionHookOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {}\n\nexport interface SubscriptionDataOptions<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n> extends BaseSubscriptionOptions<TData, TVariables> {\n subscription: DocumentNode | TypedDocumentNode<TData, TVariables>;\n children?: null | ((result: SubscriptionResult<TData>) => JSX.Element | null);\n}\n\nexport interface SubscriptionCurrentObservable {\n query?: Observable<any>;\n subscription?: ObservableSubscription;\n}\n\n/**\nHelper type that allows using a type in a way that cannot be \"widened\" by inference on the value it is used on.\n\nThis type was first suggested [in this Github discussion](https://github.com/microsoft/TypeScript/issues/14829#issuecomment-504042546).\n\nExample usage:\n```ts\nexport function useQuery<\n TData = any,\n TVariables extends OperationVariables = OperationVariables,\n>(\n query: DocumentNode | TypedDocumentNode<TData, TVariables>,\n options: QueryHookOptions<NoInfer<TData>, NoInfer<TVariables>> = Object.create(null),\n)\n```\nIn this case, `TData` and `TVariables` should be inferred from `query`, but never widened from something in `options`.\n\nSo, in this code example:\n```ts\ndeclare const typedNode: TypedDocumentNode<{ foo: string}, { bar: number }>\nconst { variables } = useQuery(typedNode, { variables: { bar: 4, nonExistingVariable: \"string\" } });\n```\nWithout the use of `NoInfer`, `variables` would now be of the type `{ bar: number, nonExistingVariable: \"string\" }`.\nWith `NoInfer`, it will instead give an error on `nonExistingVariable`.\n */\nexport type NoInfer<T> = [T][T extends any ? 0 : never];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"withConsoleSpy.d.ts","sourceRoot":"","sources":["../../../src/testing/core/withConsoleSpy.ts"],"names":[],"mappings":"AAiBA,wBAAgB,YAAY,CAAC,KAAK,SAAS,GAAG,EAAE,EAAE,OAAO,EACvD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EAC/B,GAAG,IAAI,EAAE,KAAK,WAIf;AAED,wBAAgB,cAAc,CAAC,KAAK,SAAS,GAAG,EAAE,EAAE,OAAO,EACzD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EAC/B,GAAG,IAAI,EAAE,KAAK,WAIf;AAED,wBAAgB,UAAU,CAAC,KAAK,SAAS,GAAG,EAAE,EAAE,OAAO,EACrD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EAC/B,GAAG,IAAI,EAAE,KAAK,WAIf"}
1
+ {"version":3,"file":"withConsoleSpy.d.ts","sourceRoot":"","sources":["../../../src/testing/core/withConsoleSpy.ts"],"names":[],"mappings":"AAkBA,wBAAgB,YAAY,CAAC,KAAK,SAAS,GAAG,EAAE,EAAE,OAAO,EACvD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EAC/B,GAAG,IAAI,EAAE,KAAK,WAIf;AAGD,wBAAgB,cAAc,CAAC,KAAK,SAAS,GAAG,EAAE,EAAE,OAAO,EACzD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EAC/B,GAAG,IAAI,EAAE,KAAK,WAIf;AAGD,wBAAgB,UAAU,CAAC,KAAK,SAAS,GAAG,EAAE,EAAE,OAAO,EACrD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,KAAK,OAAO,EAC/B,GAAG,IAAI,EAAE,KAAK,WAIf"}
@@ -1 +1 @@
1
- {"version":3,"file":"withConsoleSpy.js","sourceRoot":"","sources":["../../../src/testing/core/withConsoleSpy.ts"],"names":[],"mappings":"AAAA,SAAS,gBAAgB,CACvB,EAA2B,EAC3B,iBAA2C;IAE3C,OAAO;QAAA,iBAUN;QATC,IAAM,IAAI,GAAG,SAAS,CAAC;QACvB,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QACnD,GAAG,CAAC,kBAAkB,CAAC,cAAO,CAAC,CAAC,CAAC;QACjC,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO;YACzB,OAAO,CAAC,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,KAAK,CAAC,KAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC,OAAO,CAAC;YACT,MAAM,CAAC,GAAG,CAAC,CAAC,eAAe,EAAE,CAAC;YAC9B,GAAG,CAAC,SAAS,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAC1B,EAA+B;IAC/B,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAEd,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7C,OAAO,EAAE,eAAI,IAAI,EAAE;AACrB,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,EAA+B;IAC/B,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAEd,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5C,OAAO,EAAE,eAAI,IAAI,EAAE;AACrB,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,EAA+B;IAC/B,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAEd,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC3C,OAAO,EAAE,eAAI,IAAI,EAAE;AACrB,CAAC","sourcesContent":["function wrapTestFunction(\n fn: (...args: any[]) => any,\n consoleMethodName: \"log\" | \"warn\" | \"error\"\n) {\n return function () {\n const args = arguments;\n const spy = jest.spyOn(console, consoleMethodName);\n spy.mockImplementation(() => {});\n return new Promise((resolve) => {\n resolve(fn?.apply(this, args));\n }).finally(() => {\n expect(spy).toMatchSnapshot();\n spy.mockReset();\n });\n };\n}\n\nexport function withErrorSpy<TArgs extends any[], TResult>(\n it: (...args: TArgs) => TResult,\n ...args: TArgs\n) {\n args[1] = wrapTestFunction(args[1], \"error\");\n return it(...args);\n}\n\nexport function withWarningSpy<TArgs extends any[], TResult>(\n it: (...args: TArgs) => TResult,\n ...args: TArgs\n) {\n args[1] = wrapTestFunction(args[1], \"warn\");\n return it(...args);\n}\n\nexport function withLogSpy<TArgs extends any[], TResult>(\n it: (...args: TArgs) => TResult,\n ...args: TArgs\n) {\n args[1] = wrapTestFunction(args[1], \"log\");\n return it(...args);\n}\n"]}
1
+ {"version":3,"file":"withConsoleSpy.js","sourceRoot":"","sources":["../../../src/testing/core/withConsoleSpy.ts"],"names":[],"mappings":"AAAA,SAAS,gBAAgB,CACvB,EAA2B,EAC3B,iBAA2C;IAE3C,OAAO;QAAA,iBAUN;QATC,IAAM,IAAI,GAAG,SAAS,CAAC;QACvB,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;QACnD,GAAG,CAAC,kBAAkB,CAAC,cAAO,CAAC,CAAC,CAAC;QACjC,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO;YACzB,OAAO,CAAC,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,KAAK,CAAC,KAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACjC,CAAC,CAAC,CAAC,OAAO,CAAC;YACT,MAAM,CAAC,GAAG,CAAC,CAAC,eAAe,EAAE,CAAC;YAC9B,GAAG,CAAC,SAAS,EAAE,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAGD,MAAM,UAAU,YAAY,CAC1B,EAA+B;IAC/B,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAEd,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7C,OAAO,EAAE,eAAI,IAAI,EAAE;AACrB,CAAC;AAGD,MAAM,UAAU,cAAc,CAC5B,EAA+B;IAC/B,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAEd,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC5C,OAAO,EAAE,eAAI,IAAI,EAAE;AACrB,CAAC;AAGD,MAAM,UAAU,UAAU,CACxB,EAA+B;IAC/B,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAEd,IAAI,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAC3C,OAAO,EAAE,eAAI,IAAI,EAAE;AACrB,CAAC","sourcesContent":["function wrapTestFunction(\n fn: (...args: any[]) => any,\n consoleMethodName: \"log\" | \"warn\" | \"error\"\n) {\n return function () {\n const args = arguments;\n const spy = jest.spyOn(console, consoleMethodName);\n spy.mockImplementation(() => {});\n return new Promise((resolve) => {\n resolve(fn?.apply(this, args));\n }).finally(() => {\n expect(spy).toMatchSnapshot();\n spy.mockReset();\n });\n };\n}\n\n/** @deprecated This method will be removed in the next major version of Apollo Client */\nexport function withErrorSpy<TArgs extends any[], TResult>(\n it: (...args: TArgs) => TResult,\n ...args: TArgs\n) {\n args[1] = wrapTestFunction(args[1], \"error\");\n return it(...args);\n}\n\n/** @deprecated This method will be removed in the next major version of Apollo Client */\nexport function withWarningSpy<TArgs extends any[], TResult>(\n it: (...args: TArgs) => TResult,\n ...args: TArgs\n) {\n args[1] = wrapTestFunction(args[1], \"warn\");\n return it(...args);\n}\n\n/** @deprecated This method will be removed in the next major version of Apollo Client */\nexport function withLogSpy<TArgs extends any[], TResult>(\n it: (...args: TArgs) => TResult,\n ...args: TArgs\n) {\n args[1] = wrapTestFunction(args[1], \"log\");\n return it(...args);\n}\n"]}
@@ -0,0 +1,26 @@
1
+ import type { Observable } from "../../utilities/index.js";
2
+ interface TakeOptions {
3
+ timeout?: number;
4
+ }
5
+ type ObservableEvent<T> = {
6
+ type: "next";
7
+ value: T;
8
+ } | {
9
+ type: "error";
10
+ error: any;
11
+ } | {
12
+ type: "complete";
13
+ };
14
+ declare class IteratorStream<T> {
15
+ private iterator;
16
+ constructor(iterator: AsyncGenerator<T, void, unknown>);
17
+ take({ timeout }?: TakeOptions): Promise<T>;
18
+ }
19
+ export declare class ObservableStream<T> extends IteratorStream<ObservableEvent<T>> {
20
+ constructor(observable: Observable<T>);
21
+ takeNext(options?: TakeOptions): Promise<T>;
22
+ takeError(options?: TakeOptions): Promise<any>;
23
+ takeComplete(options?: TakeOptions): Promise<void>;
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=ObservableStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObservableStream.d.ts","sourceRoot":"","sources":["../../../src/testing/internal/ObservableStream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,UAAU,WAAW;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AACD,KAAK,eAAe,CAAC,CAAC,IAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAC1B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,GAAG,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AA6BzB,cAAM,cAAc,CAAC,CAAC;IACR,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC;IAExD,IAAI,CAAC,EAAE,OAAa,EAAE,GAAE,WAAgB,GAAG,OAAO,CAAC,CAAC,CAAC;CAY5D;AAED,qBAAa,gBAAgB,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBAC7D,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;IAI/B,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAM3C,SAAS,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC;IAM9C,YAAY,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAIzD"}
@@ -0,0 +1,101 @@
1
+ import { __asyncGenerator, __await, __awaiter, __extends, __generator } from "tslib";
2
+ function observableToAsyncEventIterator(observable) {
3
+ return __asyncGenerator(this, arguments, function observableToAsyncEventIterator_1() {
4
+ function queuePromise() {
5
+ promises.push(new Promise(function (resolve) {
6
+ resolveNext = function (event) {
7
+ resolve(event);
8
+ queuePromise();
9
+ };
10
+ }));
11
+ }
12
+ var resolveNext, promises;
13
+ return __generator(this, function (_a) {
14
+ switch (_a.label) {
15
+ case 0:
16
+ promises = [];
17
+ queuePromise();
18
+ observable.subscribe(function (value) { return resolveNext({ type: "next", value: value }); }, function (error) { return resolveNext({ type: "error", error: error }); }, function () { return resolveNext({ type: "complete" }); });
19
+ _a.label = 1;
20
+ case 1:
21
+ if (!true) return [3, 4];
22
+ return [4, __await(promises.shift())];
23
+ case 2: return [4, _a.sent()];
24
+ case 3:
25
+ _a.sent();
26
+ return [3, 1];
27
+ case 4: return [2];
28
+ }
29
+ });
30
+ });
31
+ }
32
+ var IteratorStream = (function () {
33
+ function IteratorStream(iterator) {
34
+ this.iterator = iterator;
35
+ }
36
+ IteratorStream.prototype.take = function (_a) {
37
+ var _b = _a === void 0 ? {} : _a, _c = _b.timeout, timeout = _c === void 0 ? 100 : _c;
38
+ return __awaiter(this, void 0, void 0, function () {
39
+ return __generator(this, function (_d) {
40
+ return [2, Promise.race([
41
+ this.iterator.next().then(function (result) { return result.value; }),
42
+ new Promise(function (_, reject) {
43
+ setTimeout(reject, timeout, new Error("Timeout waiting for next event"));
44
+ }),
45
+ ])];
46
+ });
47
+ });
48
+ };
49
+ return IteratorStream;
50
+ }());
51
+ var ObservableStream = (function (_super) {
52
+ __extends(ObservableStream, _super);
53
+ function ObservableStream(observable) {
54
+ return _super.call(this, observableToAsyncEventIterator(observable)) || this;
55
+ }
56
+ ObservableStream.prototype.takeNext = function (options) {
57
+ return __awaiter(this, void 0, void 0, function () {
58
+ var event;
59
+ return __generator(this, function (_a) {
60
+ switch (_a.label) {
61
+ case 0: return [4, this.take(options)];
62
+ case 1:
63
+ event = _a.sent();
64
+ expect(event).toEqual({ type: "next", value: expect.anything() });
65
+ return [2, event.value];
66
+ }
67
+ });
68
+ });
69
+ };
70
+ ObservableStream.prototype.takeError = function (options) {
71
+ return __awaiter(this, void 0, void 0, function () {
72
+ var event;
73
+ return __generator(this, function (_a) {
74
+ switch (_a.label) {
75
+ case 0: return [4, this.take(options)];
76
+ case 1:
77
+ event = _a.sent();
78
+ expect(event).toEqual({ type: "error", error: expect.anything() });
79
+ return [2, event.error];
80
+ }
81
+ });
82
+ });
83
+ };
84
+ ObservableStream.prototype.takeComplete = function (options) {
85
+ return __awaiter(this, void 0, void 0, function () {
86
+ var event;
87
+ return __generator(this, function (_a) {
88
+ switch (_a.label) {
89
+ case 0: return [4, this.take(options)];
90
+ case 1:
91
+ event = _a.sent();
92
+ expect(event).toEqual({ type: "complete" });
93
+ return [2];
94
+ }
95
+ });
96
+ });
97
+ };
98
+ return ObservableStream;
99
+ }(IteratorStream));
100
+ export { ObservableStream };
101
+ //# sourceMappingURL=ObservableStream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObservableStream.js","sourceRoot":"","sources":["../../../src/testing/internal/ObservableStream.ts"],"names":[],"mappings":";AAUA,SAAgB,8BAA8B,CAAI,UAAyB;;QAKzE,SAAS,YAAY;YACnB,QAAQ,CAAC,IAAI,CACX,IAAI,OAAO,CAAqB,UAAC,OAAO;gBACtC,WAAW,GAAG,UAAC,KAAyB;oBACtC,OAAO,CAAC,KAAK,CAAC,CAAC;oBACf,YAAY,EAAE,CAAC;gBACjB,CAAC,CAAC;YACJ,CAAC,CAAC,CACH,CAAC;QACJ,CAAC;;;;;oBAZK,QAAQ,GAAkC,EAAE,CAAC;oBACnD,YAAY,EAAE,CAAC;oBAaf,UAAU,CAAC,SAAS,CAClB,UAAC,KAAK,IAAK,OAAA,WAAW,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,OAAA,EAAE,CAAC,EAApC,CAAoC,EAC/C,UAAC,KAAK,IAAK,OAAA,WAAW,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,OAAA,EAAE,CAAC,EAArC,CAAqC,EAChD,cAAM,OAAA,WAAW,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAjC,CAAiC,CACxC,CAAC;;;yBAEK,IAAI;uCACH,QAAQ,CAAC,KAAK,EAAG;wBAAvB,sBAAuB;;oBAAvB,SAAuB,CAAC;;;;;;CAE3B;AAED;IACE,wBAAoB,QAA0C;QAA1C,aAAQ,GAAR,QAAQ,CAAkC;IAAG,CAAC;IAE5D,6BAAI,GAAV,UAAW,EAAmC;YAAnC,qBAAiC,EAAE,KAAA,EAAjC,eAAa,EAAb,OAAO,mBAAG,GAAG,KAAA;;;gBACxB,WAAO,OAAO,CAAC,IAAI,CAAC;wBAClB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,UAAC,MAAM,IAAK,OAAA,MAAM,CAAC,KAAM,EAAb,CAAa,CAAC;wBACpD,IAAI,OAAO,CAAI,UAAC,CAAC,EAAE,MAAM;4BACvB,UAAU,CACR,MAAM,EACN,OAAO,EACP,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAC5C,CAAC;wBACJ,CAAC,CAAC;qBACH,CAAC,EAAC;;;KACJ;IACH,qBAAC;AAAD,CAAC,AAfD,IAeC;AAED;IAAyC,oCAAkC;IACzE,0BAAY,UAAyB;eACnC,kBAAM,8BAA8B,CAAC,UAAU,CAAC,CAAC;IACnD,CAAC;IAEK,mCAAQ,GAAd,UAAe,OAAqB;;;;;4BACpB,WAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAA;;wBAAhC,KAAK,GAAG,SAAwB;wBACtC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;wBAClE,WAAQ,KAA+C,CAAC,KAAK,EAAC;;;;KAC/D;IAEK,oCAAS,GAAf,UAAgB,OAAqB;;;;;4BACrB,WAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAA;;wBAAhC,KAAK,GAAG,SAAwB;wBACtC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;wBACnE,WAAQ,KAAgD,CAAC,KAAK,EAAC;;;;KAChE;IAEK,uCAAY,GAAlB,UAAmB,OAAqB;;;;;4BACxB,WAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAA;;wBAAhC,KAAK,GAAG,SAAwB;wBACtC,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;;;;;KAC7C;IACH,uBAAC;AAAD,CAAC,AArBD,CAAyC,cAAc,GAqBtD","sourcesContent":["import type { Observable } from \"../../utilities/index.js\";\n\ninterface TakeOptions {\n timeout?: number;\n}\ntype ObservableEvent<T> =\n | { type: \"next\"; value: T }\n | { type: \"error\"; error: any }\n | { type: \"complete\" };\n\nasync function* observableToAsyncEventIterator<T>(observable: Observable<T>) {\n let resolveNext: (value: ObservableEvent<T>) => void;\n const promises: Promise<ObservableEvent<T>>[] = [];\n queuePromise();\n\n function queuePromise() {\n promises.push(\n new Promise<ObservableEvent<T>>((resolve) => {\n resolveNext = (event: ObservableEvent<T>) => {\n resolve(event);\n queuePromise();\n };\n })\n );\n }\n\n observable.subscribe(\n (value) => resolveNext({ type: \"next\", value }),\n (error) => resolveNext({ type: \"error\", error }),\n () => resolveNext({ type: \"complete\" })\n );\n\n while (true) {\n yield promises.shift()!;\n }\n}\n\nclass IteratorStream<T> {\n constructor(private iterator: AsyncGenerator<T, void, unknown>) {}\n\n async take({ timeout = 100 }: TakeOptions = {}): Promise<T> {\n return Promise.race([\n this.iterator.next().then((result) => result.value!),\n new Promise<T>((_, reject) => {\n setTimeout(\n reject,\n timeout,\n new Error(\"Timeout waiting for next event\")\n );\n }),\n ]);\n }\n}\n\nexport class ObservableStream<T> extends IteratorStream<ObservableEvent<T>> {\n constructor(observable: Observable<T>) {\n super(observableToAsyncEventIterator(observable));\n }\n\n async takeNext(options?: TakeOptions): Promise<T> {\n const event = await this.take(options);\n expect(event).toEqual({ type: \"next\", value: expect.anything() });\n return (event as ObservableEvent<T> & { type: \"next\" }).value;\n }\n\n async takeError(options?: TakeOptions): Promise<any> {\n const event = await this.take(options);\n expect(event).toEqual({ type: \"error\", error: expect.anything() });\n return (event as ObservableEvent<T> & { type: \"error\" }).error;\n }\n\n async takeComplete(options?: TakeOptions): Promise<void> {\n const event = await this.take(options);\n expect(event).toEqual({ type: \"complete\" });\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export { spyOnConsole } from "./spyOnConsole.js";
2
+ export { withCleanup } from "./withCleanup.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/internal/disposables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { spyOnConsole } from "./spyOnConsole.js";
2
+ export { withCleanup } from "./withCleanup.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/testing/internal/disposables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["export { spyOnConsole } from \"./spyOnConsole.js\";\nexport { withCleanup } from \"./withCleanup.js\";\n"]}
@@ -0,0 +1,10 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="jest" />
3
+ type ConsoleMethod = "log" | "info" | "warn" | "error" | "debug";
4
+ type Spies<Keys extends ConsoleMethod[]> = Record<Keys[number], jest.SpyInstance<void, any[], any>>;
5
+ export declare function spyOnConsole<Keys extends ConsoleMethod[]>(...spyOn: Keys): Spies<Keys> & Disposable;
6
+ export declare namespace spyOnConsole {
7
+ var takeSnapshots: <Keys extends ConsoleMethod[]>(...spyOn: Keys) => Spies<Keys> & Disposable;
8
+ }
9
+ export {};
10
+ //# sourceMappingURL=spyOnConsole.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spyOnConsole.d.ts","sourceRoot":"","sources":["../../../../src/testing/internal/disposables/spyOnConsole.ts"],"names":[],"mappings":";;AAKA,KAAK,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAEjE,KAAK,KAAK,CAAC,IAAI,SAAS,aAAa,EAAE,IAAI,MAAM,CAC/C,IAAI,CAAC,MAAM,CAAC,EACZ,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,CACnC,CAAC;AAGF,wBAAgB,YAAY,CAAC,IAAI,SAAS,aAAa,EAAE,EACvD,GAAG,KAAK,EAAE,IAAI,GACb,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,CAW1B;yBAbe,YAAY"}
@@ -0,0 +1,33 @@
1
+ import { withCleanup } from "./withCleanup.js";
2
+ var noOp = function () { };
3
+ var restore = function (spy) { return spy.mockRestore(); };
4
+ export function spyOnConsole() {
5
+ var spyOn = [];
6
+ for (var _i = 0; _i < arguments.length; _i++) {
7
+ spyOn[_i] = arguments[_i];
8
+ }
9
+ var spies = {};
10
+ for (var _a = 0, spyOn_1 = spyOn; _a < spyOn_1.length; _a++) {
11
+ var key = spyOn_1[_a];
12
+ spies[key] = jest.spyOn(console, key).mockImplementation(noOp);
13
+ }
14
+ return withCleanup(spies, function (spies) {
15
+ for (var _i = 0, _a = Object.values(spies); _i < _a.length; _i++) {
16
+ var spy = _a[_i];
17
+ restore(spy);
18
+ }
19
+ });
20
+ }
21
+ spyOnConsole.takeSnapshots = function () {
22
+ var spyOn = [];
23
+ for (var _i = 0; _i < arguments.length; _i++) {
24
+ spyOn[_i] = arguments[_i];
25
+ }
26
+ return withCleanup(spyOnConsole.apply(void 0, spyOn), function (spies) {
27
+ for (var _i = 0, _a = Object.values(spies); _i < _a.length; _i++) {
28
+ var spy = _a[_i];
29
+ expect(spy).toMatchSnapshot();
30
+ }
31
+ });
32
+ };
33
+ //# sourceMappingURL=spyOnConsole.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spyOnConsole.js","sourceRoot":"","sources":["../../../../src/testing/internal/disposables/spyOnConsole.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,IAAM,IAAI,GAAG,cAAO,CAAC,CAAC;AACtB,IAAM,OAAO,GAAG,UAAC,GAAqB,IAAK,OAAA,GAAG,CAAC,WAAW,EAAE,EAAjB,CAAiB,CAAC;AAU7D,MAAM,UAAU,YAAY;IAC1B,eAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,0BAAc;;IAEd,IAAM,KAAK,GAAG,EAAiB,CAAC;IAChC,KAAkB,UAAK,EAAL,eAAK,EAAL,mBAAK,EAAL,IAAK,EAAE;QAApB,IAAM,GAAG,cAAA;QAEZ,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAChE;IACD,OAAO,WAAW,CAAC,KAAK,EAAE,UAAC,KAAK;QAC9B,KAAkB,UAA0C,EAA1C,KAAA,MAAM,CAAC,MAAM,CAAC,KAAK,CAAuB,EAA1C,cAA0C,EAA1C,IAA0C,EAAE;YAAzD,IAAM,GAAG,SAAA;YACZ,OAAO,CAAC,GAAG,CAAC,CAAC;SACd;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,YAAY,CAAC,aAAa,GAAG;IAC3B,eAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,0BAAc;;IAEd,OAAA,WAAW,CAAC,YAAY,eAAI,KAAK,GAAG,UAAC,KAAK;QACxC,KAAkB,UAA0C,EAA1C,KAAA,MAAM,CAAC,MAAM,CAAC,KAAK,CAAuB,EAA1C,cAA0C,EAA1C,IAA0C,EAAE;YAAzD,IAAM,GAAG,SAAA;YACZ,MAAM,CAAC,GAAG,CAAC,CAAC,eAAe,EAAE,CAAC;SAC/B;IACH,CAAC,CAAC;AAJF,CAIE,CAAC","sourcesContent":["import { withCleanup } from \"./withCleanup.js\";\n\nconst noOp = () => {};\nconst restore = (spy: jest.SpyInstance) => spy.mockRestore();\n\ntype ConsoleMethod = \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\";\n\ntype Spies<Keys extends ConsoleMethod[]> = Record<\n Keys[number],\n jest.SpyInstance<void, any[], any>\n>;\n\n/** @internal */\nexport function spyOnConsole<Keys extends ConsoleMethod[]>(\n ...spyOn: Keys\n): Spies<Keys> & Disposable {\n const spies = {} as Spies<Keys>;\n for (const key of spyOn) {\n // @ts-ignore\n spies[key] = jest.spyOn(console, key).mockImplementation(noOp);\n }\n return withCleanup(spies, (spies) => {\n for (const spy of Object.values(spies) as jest.SpyInstance[]) {\n restore(spy);\n }\n });\n}\n\nspyOnConsole.takeSnapshots = <Keys extends ConsoleMethod[]>(\n ...spyOn: Keys\n): Spies<Keys> & Disposable =>\n withCleanup(spyOnConsole(...spyOn), (spies) => {\n for (const spy of Object.values(spies) as jest.SpyInstance[]) {\n expect(spy).toMatchSnapshot();\n }\n });\n"]}
@@ -0,0 +1,3 @@
1
+ /// <reference types="node" />
2
+ export declare function withCleanup<T extends object>(item: T, cleanup: (item: T) => void): T & Disposable;
3
+ //# sourceMappingURL=withCleanup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withCleanup.d.ts","sourceRoot":"","sources":["../../../../src/testing/internal/disposables/withCleanup.ts"],"names":[],"mappings":";AACA,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAC1C,IAAI,EAAE,CAAC,EACP,OAAO,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GACzB,CAAC,GAAG,UAAU,CAYhB"}
@@ -0,0 +1,11 @@
1
+ import { __assign } from "tslib";
2
+ export function withCleanup(item, cleanup) {
3
+ var _a;
4
+ return __assign(__assign({}, item), (_a = {}, _a[Symbol.dispose] = function () {
5
+ cleanup(item);
6
+ if (Symbol.dispose in item) {
7
+ item[Symbol.dispose]();
8
+ }
9
+ }, _a));
10
+ }
11
+ //# sourceMappingURL=withCleanup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withCleanup.js","sourceRoot":"","sources":["../../../../src/testing/internal/disposables/withCleanup.ts"],"names":[],"mappings":";AACA,MAAM,UAAU,WAAW,CACzB,IAAO,EACP,OAA0B;;IAE1B,6BACK,IAAI,aACP,GAAC,MAAM,CAAC,OAAO,IAAf;QACE,OAAO,CAAC,IAAI,CAAC,CAAC;QAGd,IAAI,MAAM,CAAC,OAAO,IAAI,IAAI,EAAE;YACzB,IAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;SACxC;IACH,CAAC,OACD;AACJ,CAAC","sourcesContent":["/** @internal */\nexport function withCleanup<T extends object>(\n item: T,\n cleanup: (item: T) => void\n): T & Disposable {\n return {\n ...item,\n [Symbol.dispose]() {\n cleanup(item);\n // if `item` already has a cleanup function, we also need to call the original cleanup function\n // (e.g. if something is wrapped in `withCleanup` twice)\n if (Symbol.dispose in item) {\n (item as Disposable)[Symbol.dispose]();\n }\n },\n };\n}\n"]}
@@ -0,0 +1,4 @@
1
+ export * from "./profile/index.js";
2
+ export * from "./disposables/index.js";
3
+ export { ObservableStream } from "./ObservableStream.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/testing/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./profile/index.js";
2
+ export * from "./disposables/index.js";
3
+ export { ObservableStream } from "./ObservableStream.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/testing/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["export * from \"./profile/index.js\";\nexport * from \"./disposables/index.js\";\nexport { ObservableStream } from \"./ObservableStream.js\";\n"]}
@@ -0,0 +1,140 @@
1
+ import { screen } from "@testing-library/dom";
2
+ export interface BaseRender {
3
+ id: string;
4
+ phase: "mount" | "update" | "nested-update";
5
+ actualDuration: number;
6
+ baseDuration: number;
7
+ startTime: number;
8
+ commitTime: number;
9
+ count: number;
10
+ }
11
+ type Screen = typeof screen;
12
+ export type SyncScreen = {
13
+ [K in keyof Screen]: K extends `find${string}` ? {
14
+ (...args: Parameters<Screen[K]>): ReturnType<Screen[K]>;
15
+ } : Screen[K];
16
+ };
17
+ export interface Render<Snapshot> extends BaseRender {
18
+ snapshot: Snapshot;
19
+ readonly domSnapshot: HTMLElement;
20
+ withinDOM: () => SyncScreen;
21
+ }
22
+ export declare class RenderInstance<Snapshot> implements Render<Snapshot> {
23
+ snapshot: Snapshot;
24
+ private stringifiedDOM;
25
+ id: string;
26
+ phase: "mount" | "update" | "nested-update";
27
+ actualDuration: number;
28
+ baseDuration: number;
29
+ startTime: number;
30
+ commitTime: number;
31
+ count: number;
32
+ constructor(baseRender: BaseRender, snapshot: Snapshot, stringifiedDOM: string | undefined);
33
+ private _domSnapshot;
34
+ get domSnapshot(): HTMLElement;
35
+ get withinDOM(): () => {
36
+ getByLabelText<T extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T;
37
+ getAllByLabelText<T_1 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_1[];
38
+ queryByLabelText<T_2 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_2 | null;
39
+ queryAllByLabelText<T_3 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_3[];
40
+ findByLabelText<T_4 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_4>;
41
+ findAllByLabelText<T_5 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_5[]>;
42
+ getByPlaceholderText<T_6 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_6;
43
+ getAllByPlaceholderText<T_7 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_7[];
44
+ queryByPlaceholderText<T_8 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_8 | null;
45
+ queryAllByPlaceholderText<T_9 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_9[];
46
+ findByPlaceholderText<T_10 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_10>;
47
+ findAllByPlaceholderText<T_11 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_11[]>;
48
+ getByText<T_12 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_12;
49
+ getAllByText<T_13 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_13[];
50
+ queryByText<T_14 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_14 | null;
51
+ queryAllByText<T_15 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined): T_15[];
52
+ findByText<T_16 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_16>;
53
+ findAllByText<T_17 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_17[]>;
54
+ getByAltText<T_18 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_18;
55
+ getAllByAltText<T_19 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_19[];
56
+ queryByAltText<T_20 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_20 | null;
57
+ queryAllByAltText<T_21 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_21[];
58
+ findByAltText<T_22 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_22>;
59
+ findAllByAltText<T_23 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_23[]>;
60
+ getByTitle<T_24 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_24;
61
+ getAllByTitle<T_25 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_25[];
62
+ queryByTitle<T_26 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_26 | null;
63
+ queryAllByTitle<T_27 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_27[];
64
+ findByTitle<T_28 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_28>;
65
+ findAllByTitle<T_29 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_29[]>;
66
+ getByDisplayValue<T_30 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_30;
67
+ getAllByDisplayValue<T_31 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_31[];
68
+ queryByDisplayValue<T_32 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_32 | null;
69
+ queryAllByDisplayValue<T_33 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_33[];
70
+ findByDisplayValue<T_34 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_34>;
71
+ findAllByDisplayValue<T_35 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_35[]>;
72
+ getByRole<T_36 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined): T_36;
73
+ getAllByRole<T_37 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined): T_37[];
74
+ queryByRole<T_38 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined): T_38 | null;
75
+ queryAllByRole<T_39 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined): T_39[];
76
+ findByRole<T_40 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_40>;
77
+ findAllByRole<T_41 extends HTMLElement = HTMLElement>(role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_41[]>;
78
+ getByTestId<T_42 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_42;
79
+ getAllByTestId<T_43 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_43[];
80
+ queryByTestId<T_44 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_44 | null;
81
+ queryAllByTestId<T_45 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined): T_45[];
82
+ findByTestId<T_46 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_46>;
83
+ findAllByTestId<T_47 extends HTMLElement = HTMLElement>(id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined): Promise<T_47[]>;
84
+ } & {
85
+ getByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
86
+ getAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
87
+ queryByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
88
+ queryAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
89
+ findByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
90
+ findAllByLabelText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
91
+ getByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
92
+ getAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
93
+ queryByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
94
+ queryAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
95
+ findByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
96
+ findAllByPlaceholderText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
97
+ getByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement;
98
+ getAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
99
+ queryByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement | null;
100
+ queryAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined) => HTMLElement[];
101
+ findByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
102
+ findAllByText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").SelectorMatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
103
+ getByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
104
+ getAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
105
+ queryByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
106
+ queryAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
107
+ findByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
108
+ findAllByAltText: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
109
+ getByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
110
+ getAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
111
+ queryByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
112
+ queryAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
113
+ findByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
114
+ findAllByTitle: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
115
+ getByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
116
+ getAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
117
+ queryByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
118
+ queryAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
119
+ findByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
120
+ findAllByDisplayValue: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
121
+ getByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement;
122
+ getAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement[];
123
+ queryByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement | null;
124
+ queryAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined) => HTMLElement[];
125
+ findByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
126
+ findAllByRole: (role: import("@testing-library/dom").ByRoleMatcher, options?: import("@testing-library/dom").ByRoleOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
127
+ getByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement;
128
+ getAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
129
+ queryByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement | null;
130
+ queryAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined) => HTMLElement[];
131
+ findByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement>;
132
+ findAllByTestId: (id: import("@testing-library/dom").Matcher, options?: import("@testing-library/dom").MatcherOptions | undefined, waitForElementOptions?: import("@testing-library/dom").waitForOptions | undefined) => Promise<HTMLElement[]>;
133
+ } & {
134
+ debug: (element?: Element | HTMLDocument | (Element | HTMLDocument)[] | undefined, maxLength?: number | undefined, options?: import("pretty-format").PrettyFormatOptions | undefined) => void;
135
+ logTestingPlaygroundURL: (element?: Element | HTMLDocument | undefined) => void;
136
+ };
137
+ }
138
+ export declare function errorOnDomInteraction(): void;
139
+ export {};
140
+ //# sourceMappingURL=Render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Render.d.ts","sourceRoot":"","sources":["../../../../src/testing/internal/profile/Render.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAU,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAKtD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,eAAe,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IAInB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,KAAK,MAAM,GAAG,OAAO,MAAM,CAAC;AAE5B,MAAM,MAAM,UAAU,GAAG;KACtB,CAAC,IAAI,MAAM,MAAM,GAAG,CAAC,SAAS,OAAO,MAAM,EAAE,GAC1C;QAEE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KACzD,GACD,MAAM,CAAC,CAAC,CAAC;CACd,CAAC;AAGF,MAAM,WAAW,MAAM,CAAC,QAAQ,CAAE,SAAQ,UAAU;IAKlD,QAAQ,EAAE,QAAQ,CAAC;IAKnB,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAYlC,SAAS,EAAE,MAAM,UAAU,CAAC;CAC7B;AAGD,qBAAa,cAAc,CAAC,QAAQ,CAAE,YAAW,MAAM,CAAC,QAAQ,CAAC;IAWtD,QAAQ,EAAE,QAAQ;IACzB,OAAO,CAAC,cAAc;IAXxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,eAAe,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;gBAGZ,UAAU,EAAE,UAAU,EACf,QAAQ,EAAE,QAAQ,EACjB,cAAc,EAAE,MAAM,GAAG,SAAS;IAW5C,OAAO,CAAC,YAAY,CAA0B;IAC9C,IAAI,WAAW,gBA8Bd;IAED,IAAI,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBZ;CACF;AAED,wBAAgB,qBAAqB,SA6DpC"}