This commit is contained in:
2024-11-28 23:08:17 +01:00
parent 8895fde030
commit 0dda8e760c
16116 changed files with 2866428 additions and 71 deletions

65
node_modules/@vue/test-utils/dist/baseWrapper.d.ts generated vendored Normal file
View File

@@ -0,0 +1,65 @@
import type { TriggerOptions } from './createDomEvent';
import { ComponentInternalInstance, ComponentOptions, ComponentPublicInstance, ComputedOptions, CreateComponentPublicInstance, FunctionalComponent, MethodOptions } from 'vue';
import { DomEventNameWithModifier } from './constants/dom-events';
import type { VueWrapper } from './vueWrapper';
import { DefinedComponent, FindAllComponentsSelector, FindComponentSelector, NameSelector, RefSelector, VueNode } from './types';
import WrapperLike from './interfaces/wrapperLike';
import type { DOMWrapper } from './domWrapper';
export default abstract class BaseWrapper<ElementType extends Node> implements WrapperLike {
protected readonly wrapperElement: VueNode<ElementType>;
protected abstract getRootNodes(): VueNode[];
get element(): VueNode<ElementType>;
protected constructor(element: ElementType);
protected findAllDOMElements(selector: string): Element[];
find<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>;
find<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>;
find<T extends Element = Element>(selector: string): DOMWrapper<T>;
find<T extends Node = Node>(selector: string | RefSelector): DOMWrapper<T>;
abstract findAll<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>[];
abstract findAll<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>[];
abstract findAll<T extends Element>(selector: string): DOMWrapper<T>[];
abstract findAll(selector: string): DOMWrapper<Element>[];
findComponent<T extends never>(selector: string): WrapperLike;
findComponent<Props, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions>(selector: ComponentOptions<Props, RawBindings, D, C, M>): VueWrapper<CreateComponentPublicInstance<Props, RawBindings, D, C, M>>;
findComponent<T extends ComponentOptions>(selector: string): VueWrapper<T extends ComponentOptions<infer Props, infer RawBindings, infer D, infer C, infer M> ? CreateComponentPublicInstance<Props, RawBindings, D, C, M> : VueWrapper<CreateComponentPublicInstance>>;
findComponent<T extends DefinedComponent>(selector: T | Exclude<FindComponentSelector, FunctionalComponent>): VueWrapper<InstanceType<T>>;
findComponent<T extends FunctionalComponent>(selector: T): DOMWrapper<Node>;
findComponent<T extends FunctionalComponent>(selector: string): DOMWrapper<Element>;
findComponent<T extends never>(selector: NameSelector | RefSelector): VueWrapper;
findComponent<T extends ComponentPublicInstance>(selector: T | FindComponentSelector): VueWrapper<T>;
findComponent<T extends never>(selector: FindComponentSelector): WrapperLike;
findAllComponents<T extends never>(selector: string): WrapperLike[];
findAllComponents<T extends DefinedComponent>(selector: T | Exclude<FindAllComponentsSelector, FunctionalComponent>): VueWrapper<InstanceType<T>>[];
findAllComponents<T extends FunctionalComponent>(selector: T): DOMWrapper<Node>[];
findAllComponents<T extends FunctionalComponent>(selector: string): DOMWrapper<Element>[];
findAllComponents<T extends never>(selector: NameSelector): VueWrapper[];
findAllComponents<T extends ComponentPublicInstance>(selector: T | FindAllComponentsSelector): VueWrapper<T>[];
findAllComponents<T extends never>(selector: FindAllComponentsSelector): WrapperLike[];
abstract setValue(value?: any): Promise<void>;
html(options?: {
raw?: boolean;
}): string;
classes(): string[];
classes(className: string): boolean;
attributes(): {
[key: string]: string;
};
attributes(key: string): string | undefined;
text(): string;
exists(): boolean;
get<K extends keyof HTMLElementTagNameMap>(selector: K): Omit<DOMWrapper<HTMLElementTagNameMap[K]>, 'exists'>;
get<K extends keyof SVGElementTagNameMap>(selector: K): Omit<DOMWrapper<SVGElementTagNameMap[K]>, 'exists'>;
get<T extends Element = Element>(selector: string): Omit<DOMWrapper<T>, 'exists'>;
get<T extends Node = Node>(selector: string | RefSelector): Omit<DOMWrapper<T>, 'exists'>;
getComponent<T extends never>(selector: string): Omit<WrapperLike, 'exists'>;
getComponent<T extends DefinedComponent>(selector: T | Exclude<FindComponentSelector, FunctionalComponent>): Omit<VueWrapper<InstanceType<T>>, 'exists'>;
getComponent<T extends FunctionalComponent>(selector: T | string): Omit<DOMWrapper<Element>, 'exists'>;
getComponent<T extends never>(selector: NameSelector | RefSelector): Omit<VueWrapper, 'exists'>;
getComponent<T extends ComponentPublicInstance>(selector: T | FindComponentSelector): Omit<VueWrapper<T>, 'exists'>;
getComponent<T extends never>(selector: FindComponentSelector): Omit<WrapperLike, 'exists'>;
protected isDisabled: () => boolean;
isVisible(): boolean;
protected abstract getCurrentComponent(): ComponentInternalInstance | void;
trigger(eventString: DomEventNameWithModifier, options?: TriggerOptions): Promise<void>;
trigger(eventString: string, options?: TriggerOptions): Promise<void>;
}

View File

@@ -0,0 +1,21 @@
export declare const RouterLinkStub: import("vue").DefineComponent<{
to: {
type: (ObjectConstructor | StringConstructor)[];
required: true;
};
custom: {
type: BooleanConstructor;
default: boolean;
};
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
to: {
type: (ObjectConstructor | StringConstructor)[];
required: true;
};
custom: {
type: BooleanConstructor;
default: boolean;
};
}>>, {
custom: boolean;
}, {}>;

33
node_modules/@vue/test-utils/dist/config.d.ts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
import { GlobalMountOptions, Stub } from './types';
import { VueWrapper } from './vueWrapper';
import { DOMWrapper } from './domWrapper';
import { CustomCreateStub } from './vnodeTransformers/stubComponentsTransformer';
export interface GlobalConfigOptions {
global: Required<Omit<GlobalMountOptions, 'stubs'>> & {
stubs: Record<string, Stub>;
};
plugins: {
VueWrapper: Pluggable<VueWrapper>;
DOMWrapper: Pluggable<DOMWrapper<Node>>;
createStubs?: CustomCreateStub;
};
/**
* @deprecated use global.
*/
renderStubDefaultSlot?: boolean;
}
interface Plugin<Instance, O> {
handler(instance: Instance): Record<string, any>;
handler(instance: Instance, options: O): Record<string, any>;
options: O;
}
declare class Pluggable<Instance = DOMWrapper<Node>> {
installedPlugins: Plugin<Instance, any>[];
install<O>(handler: (instance: Instance) => Record<string, any>): void;
install<O>(handler: (instance: Instance, options: O) => Record<string, any>, options: O): void;
extend(instance: Instance): void;
/** For testing */
reset(): void;
}
export declare const config: GlobalConfigOptions;
export {};

View File

@@ -0,0 +1,900 @@
export type EventInterface = 'AnimationEvent' | 'AudioProcessingEvent' | 'BeforeInputEvent' | 'BeforeUnloadEvent' | 'BlobEvent' | 'CSSFontFaceLoadEvent' | 'ClipboardEvent' | 'CloseEvent' | 'CompositionEvent' | 'CustomEvent' | 'DOMTransactionEvent' | 'DeviceLightEvent' | 'DeviceMotionEvent' | 'DeviceOrientationEvent' | 'DeviceProximityEvent' | 'DragEvent' | 'EditingBeforeInputEvent' | 'ErrorEvent' | 'Event' | 'FetchEvent' | 'FocusEvent' | 'GamepadEvent' | 'HashChangeEvent' | 'IDBVersionChangeEvent' | 'InputEvent' | 'KeyboardEvent' | 'MediaStreamEvent' | 'MessageEvent' | 'MouseEvent' | 'MutationEvent' | 'OfflineAudioCompletionEvent' | 'OverconstrainedError' | 'PageTransitionEvent' | 'PaymentRequestUpdateEvent' | 'PointerEvent' | 'PopStateEvent' | 'ProgressEvent' | 'RTCDataChannelEvent' | 'RTCIdentityErrorEvent' | 'RTCIdentityEvent' | 'RTCPeerConnectionIceEvent' | 'RelatedEvent' | 'SVGEvent' | 'SVGZoomEvent' | 'SensorEvent' | 'StorageEvent' | 'TimeEvent' | 'TouchEvent' | 'TrackEvent' | 'TransitionEvent' | 'UIEvent' | 'UserProximityEvent' | 'WebGLContextEvent' | 'WheelEvent';
export interface DomEvent {
eventInterface: EventInterface | string;
bubbles: boolean;
cancelable: boolean;
}
export type DomEventName = keyof typeof domEvents;
export declare const ignorableKeyModifiers: string[];
export declare const systemKeyModifiers: readonly ["ctrl", "shift", "alt", "meta"];
export declare const mouseKeyModifiers: readonly ["left", "middle", "right"];
export declare const keyCodesByKeyName: {
readonly backspace: 8;
readonly tab: 9;
readonly enter: 13;
readonly esc: 27;
readonly space: 32;
readonly pageup: 33;
readonly pagedown: 34;
readonly end: 35;
readonly home: 36;
readonly left: 37;
readonly up: 38;
readonly right: 39;
readonly down: 40;
readonly insert: 45;
readonly delete: 46;
};
export type KeyName = keyof typeof keyCodesByKeyName;
export type Modifier = (typeof systemKeyModifiers)[number] | (typeof mouseKeyModifiers)[number];
export type DomEventNameWithModifier = DomEventName | `${DomEventName}.${(typeof systemKeyModifiers)[number]}` | `click.${(typeof mouseKeyModifiers)[number]}` | `click.${(typeof systemKeyModifiers)[number]}.${(typeof mouseKeyModifiers)[number]}` | `${'keydown' | 'keyup'}.${keyof typeof keyCodesByKeyName}` | `${'keydown' | 'keyup'}.${(typeof systemKeyModifiers)[number]}.${keyof typeof keyCodesByKeyName}`;
declare const domEvents: {
readonly abort: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly afterprint: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly animationend: {
readonly eventInterface: "AnimationEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly animationiteration: {
readonly eventInterface: "AnimationEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly animationstart: {
readonly eventInterface: "AnimationEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly appinstalled: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
/**
* @deprecated
*/
readonly audioprocess: {
readonly eventInterface: "AudioProcessingEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly audioend: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly audiostart: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly beforeprint: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly beforeunload: {
readonly eventInterface: "BeforeUnloadEvent";
readonly bubbles: false;
readonly cancelable: true;
};
readonly beginEvent: {
readonly eventInterface: "TimeEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly blur: {
readonly eventInterface: "FocusEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly boundary: {
readonly eventInterface: "SpeechSynthesisEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly cached: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly canplay: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly canplaythrough: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly change: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: false;
};
readonly chargingchange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly chargingtimechange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly checking: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly click: {
readonly eventInterface: "MouseEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly close: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly complete: {
readonly eventInterface: "OfflineAudioCompletionEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly compositionend: {
readonly eventInterface: "CompositionEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly compositionstart: {
readonly eventInterface: "CompositionEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly compositionupdate: {
readonly eventInterface: "CompositionEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly contextmenu: {
readonly eventInterface: "MouseEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly copy: {
readonly eventInterface: "ClipboardEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly cut: {
readonly eventInterface: "ClipboardEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly dblclick: {
readonly eventInterface: "MouseEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly devicechange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly devicelight: {
readonly eventInterface: "DeviceLightEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly devicemotion: {
readonly eventInterface: "DeviceMotionEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly deviceorientation: {
readonly eventInterface: "DeviceOrientationEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly deviceproximity: {
readonly eventInterface: "DeviceProximityEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly dischargingtimechange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly DOMActivate: {
readonly eventInterface: "UIEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMAttributeNameChanged: {
readonly eventInterface: "MutationNameEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMAttrModified: {
readonly eventInterface: "MutationEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMCharacterDataModified: {
readonly eventInterface: "MutationEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMContentLoaded: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMElementNameChanged: {
readonly eventInterface: "MutationNameEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMFocusIn: {
readonly eventInterface: "FocusEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMFocusOut: {
readonly eventInterface: "FocusEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMNodeInserted: {
readonly eventInterface: "MutationEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMNodeInsertedIntoDocument: {
readonly eventInterface: "MutationEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMNodeRemoved: {
readonly eventInterface: "MutationEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly DOMNodeRemovedFromDocument: {
readonly eventInterface: "MutationEvent";
readonly bubbles: true;
readonly cancelable: true;
};
/**
* @deprecated
*/
readonly DOMSubtreeModified: {
readonly eventInterface: "MutationEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly downloading: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly drag: {
readonly eventInterface: "DragEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly dragend: {
readonly eventInterface: "DragEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly dragenter: {
readonly eventInterface: "DragEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly dragleave: {
readonly eventInterface: "DragEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly dragover: {
readonly eventInterface: "DragEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly dragstart: {
readonly eventInterface: "DragEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly drop: {
readonly eventInterface: "DragEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly durationchange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly emptied: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly end: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly ended: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly endEvent: {
readonly eventInterface: "TimeEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly error: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly focus: {
readonly eventInterface: "FocusEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly focusin: {
readonly eventInterface: "FocusEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly focusout: {
readonly eventInterface: "FocusEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly fullscreenchange: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: false;
};
readonly fullscreenerror: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: false;
};
readonly gamepadconnected: {
readonly eventInterface: "GamepadEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly gamepaddisconnected: {
readonly eventInterface: "GamepadEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly gotpointercapture: {
readonly eventInterface: "PointerEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly hashchange: {
readonly eventInterface: "HashChangeEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly lostpointercapture: {
readonly eventInterface: "PointerEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly input: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: false;
};
readonly invalid: {
readonly eventInterface: "Event";
readonly cancelable: true;
readonly bubbles: false;
};
readonly keydown: {
readonly eventInterface: "KeyboardEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly keypress: {
readonly eventInterface: "KeyboardEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly keyup: {
readonly eventInterface: "KeyboardEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly languagechange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly levelchange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly load: {
readonly eventInterface: "UIEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly loadeddata: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly loadedmetadata: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly loadend: {
readonly eventInterface: "ProgressEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly loadstart: {
readonly eventInterface: "ProgressEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly mark: {
readonly eventInterface: "SpeechSynthesisEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly message: {
readonly eventInterface: "MessageEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly messageerror: {
readonly eventInterface: "MessageEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly mousedown: {
readonly eventInterface: "MouseEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly mouseenter: {
readonly eventInterface: "MouseEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly mouseleave: {
readonly eventInterface: "MouseEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly mousemove: {
readonly eventInterface: "MouseEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly mouseout: {
readonly eventInterface: "MouseEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly mouseover: {
readonly eventInterface: "MouseEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly mouseup: {
readonly eventInterface: "MouseEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly nomatch: {
readonly eventInterface: "SpeechRecognitionEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly notificationclick: {
readonly eventInterface: "NotificationEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly noupdate: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly obsolete: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly offline: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly online: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly open: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly orientationchange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly pagehide: {
readonly eventInterface: "PageTransitionEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly pageshow: {
readonly eventInterface: "PageTransitionEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly paste: {
readonly eventInterface: "ClipboardEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly pause: {
readonly eventInterface: "SpeechSynthesisEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly pointercancel: {
readonly eventInterface: "PointerEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly pointerdown: {
readonly eventInterface: "PointerEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly pointerenter: {
readonly eventInterface: "PointerEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly pointerleave: {
readonly eventInterface: "PointerEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly pointerlockchange: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: false;
};
readonly pointerlockerror: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: false;
};
readonly pointermove: {
readonly eventInterface: "PointerEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly pointerout: {
readonly eventInterface: "PointerEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly pointerover: {
readonly eventInterface: "PointerEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly pointerup: {
readonly eventInterface: "PointerEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly play: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly playing: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly popstate: {
readonly eventInterface: "PopStateEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly progress: {
readonly eventInterface: "ProgressEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly push: {
readonly eventInterface: "PushEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly pushsubscriptionchange: {
readonly eventInterface: "PushEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly ratechange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly readystatechange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly repeatEvent: {
readonly eventInterface: "TimeEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly reset: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: true;
};
readonly resize: {
readonly eventInterface: "UIEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly resourcetimingbufferfull: {
readonly eventInterface: "Performance";
readonly bubbles: true;
readonly cancelable: true;
};
readonly result: {
readonly eventInterface: "SpeechRecognitionEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly resume: {
readonly eventInterface: "SpeechSynthesisEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly scroll: {
readonly eventInterface: "UIEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly seeked: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly seeking: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly select: {
readonly eventInterface: "UIEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly selectstart: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: true;
};
readonly selectionchange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly show: {
readonly eventInterface: "MouseEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly slotchange: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: false;
};
readonly soundend: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly soundstart: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly speechend: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly speechstart: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly stalled: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly start: {
readonly eventInterface: "SpeechSynthesisEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly storage: {
readonly eventInterface: "StorageEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly submit: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: true;
};
readonly success: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly suspend: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly SVGAbort: {
readonly eventInterface: "SVGEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly SVGError: {
readonly eventInterface: "SVGEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly SVGLoad: {
readonly eventInterface: "SVGEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly SVGResize: {
readonly eventInterface: "SVGEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly SVGScroll: {
readonly eventInterface: "SVGEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly SVGUnload: {
readonly eventInterface: "SVGEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly SVGZoom: {
readonly eventInterface: "SVGZoomEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly timeout: {
readonly eventInterface: "ProgressEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly timeupdate: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly touchcancel: {
readonly eventInterface: "TouchEvent";
readonly bubbles: true;
readonly cancelable: false;
};
readonly touchend: {
readonly eventInterface: "TouchEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly touchmove: {
readonly eventInterface: "TouchEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly touchstart: {
readonly eventInterface: "TouchEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly transitionend: {
readonly eventInterface: "TransitionEvent";
readonly bubbles: true;
readonly cancelable: true;
};
readonly unload: {
readonly eventInterface: "UIEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly updateready: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly userproximity: {
readonly eventInterface: "UserProximityEvent";
readonly bubbles: false;
readonly cancelable: false;
};
readonly voiceschanged: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly visibilitychange: {
readonly eventInterface: "Event";
readonly bubbles: true;
readonly cancelable: false;
};
readonly volumechange: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly waiting: {
readonly eventInterface: "Event";
readonly bubbles: false;
readonly cancelable: false;
};
readonly wheel: {
readonly eventInterface: "WheelEvent";
readonly bubbles: true;
readonly cancelable: true;
};
};
declare const _default: Record<"abort" | "afterprint" | "animationend" | "animationiteration" | "animationstart" | "appinstalled" | "audioprocess" | "audioend" | "audiostart" | "beforeprint" | "beforeunload" | "beginEvent" | "blur" | "boundary" | "cached" | "canplay" | "canplaythrough" | "change" | "chargingchange" | "chargingtimechange" | "checking" | "click" | "close" | "complete" | "compositionend" | "compositionstart" | "compositionupdate" | "contextmenu" | "copy" | "cut" | "dblclick" | "devicechange" | "devicelight" | "devicemotion" | "deviceorientation" | "deviceproximity" | "dischargingtimechange" | "DOMActivate" | "DOMAttributeNameChanged" | "DOMAttrModified" | "DOMCharacterDataModified" | "DOMContentLoaded" | "DOMElementNameChanged" | "DOMFocusIn" | "DOMFocusOut" | "DOMNodeInserted" | "DOMNodeInsertedIntoDocument" | "DOMNodeRemoved" | "DOMNodeRemovedFromDocument" | "DOMSubtreeModified" | "downloading" | "drag" | "dragend" | "dragenter" | "dragleave" | "dragover" | "dragstart" | "drop" | "durationchange" | "emptied" | "end" | "ended" | "endEvent" | "error" | "focus" | "focusin" | "focusout" | "fullscreenchange" | "fullscreenerror" | "gamepadconnected" | "gamepaddisconnected" | "gotpointercapture" | "hashchange" | "lostpointercapture" | "input" | "invalid" | "keydown" | "keypress" | "keyup" | "languagechange" | "levelchange" | "load" | "loadeddata" | "loadedmetadata" | "loadend" | "loadstart" | "mark" | "message" | "messageerror" | "mousedown" | "mouseenter" | "mouseleave" | "mousemove" | "mouseout" | "mouseover" | "mouseup" | "nomatch" | "notificationclick" | "noupdate" | "obsolete" | "offline" | "online" | "open" | "orientationchange" | "pagehide" | "pageshow" | "paste" | "pause" | "pointercancel" | "pointerdown" | "pointerenter" | "pointerleave" | "pointerlockchange" | "pointerlockerror" | "pointermove" | "pointerout" | "pointerover" | "pointerup" | "play" | "playing" | "popstate" | "progress" | "push" | "pushsubscriptionchange" | "ratechange" | "readystatechange" | "repeatEvent" | "reset" | "resize" | "resourcetimingbufferfull" | "result" | "resume" | "scroll" | "seeked" | "seeking" | "select" | "selectstart" | "selectionchange" | "show" | "slotchange" | "soundend" | "soundstart" | "speechend" | "speechstart" | "stalled" | "start" | "storage" | "submit" | "success" | "suspend" | "SVGAbort" | "SVGError" | "SVGLoad" | "SVGResize" | "SVGScroll" | "SVGUnload" | "SVGZoom" | "timeout" | "timeupdate" | "touchcancel" | "touchend" | "touchmove" | "touchstart" | "transitionend" | "unload" | "updateready" | "userproximity" | "voiceschanged" | "visibilitychange" | "volumechange" | "waiting" | "wheel", DomEvent>;
export default _default;

View File

@@ -0,0 +1,9 @@
import { DomEventNameWithModifier, KeyName, keyCodesByKeyName } from './constants/dom-events';
interface TriggerOptions {
code?: String;
key?: String;
keyCode?: Number;
[custom: string]: any;
}
declare function createDOMEvent(eventString: DomEventNameWithModifier | string, options?: TriggerOptions): Event & TriggerOptions;
export { TriggerOptions, createDOMEvent, keyCodesByKeyName, KeyName };

View File

@@ -0,0 +1,7 @@
import { DefineComponent } from 'vue';
import { MountingOptions } from './types';
export declare function createInstance(inputComponent: DefineComponent<{}, {}, any, any, any, any>, options?: MountingOptions<any> & Record<string, any>): {
app: import("vue").App<Element>;
props: Record<string, unknown>;
componentRef: import("vue").Ref<null>;
};

18
node_modules/@vue/test-utils/dist/domWrapper.d.ts generated vendored Normal file
View File

@@ -0,0 +1,18 @@
import BaseWrapper from './baseWrapper';
import { RefSelector } from './types';
export declare class DOMWrapper<NodeType extends Node> extends BaseWrapper<NodeType> {
constructor(element: NodeType | null | undefined);
getRootNodes(): import("./types").VueNode<NodeType>[];
getCurrentComponent(): import("vue").ComponentInternalInstance | undefined;
find<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>;
find<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>;
find<T extends Element = Element>(selector: string): DOMWrapper<T>;
find<T extends Node = Node>(selector: string | RefSelector): DOMWrapper<T>;
findAll<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>[];
findAll<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>[];
findAll<T extends Element>(selector: string): DOMWrapper<T>[];
findAllComponents(selector: any): any;
private setChecked;
setValue(value?: any): Promise<void>;
private setSelected;
}

5
node_modules/@vue/test-utils/dist/emit.d.ts generated vendored Normal file
View File

@@ -0,0 +1,5 @@
import { ComponentPublicInstance, ComponentInternalInstance } from 'vue';
export declare function emitted<T = unknown>(vm: ComponentPublicInstance, eventName?: string): undefined | T[] | Record<string, T[]>;
export declare const attachEmitListener: () => void;
export declare const recordEvent: (vm: ComponentInternalInstance, event: string, args: unknown[]) => void;
export declare const removeEventHistory: (vm: ComponentPublicInstance) => void;

1
node_modules/@vue/test-utils/dist/errorWrapper.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function createWrapperError<T extends object>(wrapperType: 'DOMWrapper' | 'VueWrapper'): T;

13
node_modules/@vue/test-utils/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
import { DOMWrapper } from './domWrapper';
import { VueWrapper } from './vueWrapper';
import BaseWrapper from './baseWrapper';
import { mount, shallowMount } from './mount';
import { renderToString } from './renderToString';
import { MountingOptions } from './types';
import { RouterLinkStub } from './components/RouterLinkStub';
import { createWrapperError } from './errorWrapper';
import { config } from './config';
import { flushPromises } from './utils/flushPromises';
import { enableAutoUnmount, disableAutoUnmount } from './utils/autoUnmount';
export { mount, shallowMount, renderToString, enableAutoUnmount, disableAutoUnmount, RouterLinkStub, VueWrapper, DOMWrapper, BaseWrapper, config, flushPromises, MountingOptions, createWrapperError };
export type { ComponentMountingOptions } from './mount';

View File

@@ -0,0 +1,56 @@
import { DomEventNameWithModifier } from '../constants/dom-events';
import { TriggerOptions } from '../createDomEvent';
import { DefinedComponent, FindAllComponentsSelector, FindComponentSelector, NameSelector, RefSelector } from '../types';
import { VueWrapper } from '../vueWrapper';
import { ComponentPublicInstance, FunctionalComponent } from 'vue';
import type { DOMWrapper } from '../domWrapper';
export default interface WrapperLike {
readonly element: Node;
find<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>;
find<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>;
find<T extends Element = Element>(selector: string): DOMWrapper<T>;
find<T extends Node = Node>(selector: string | RefSelector): DOMWrapper<T>;
findAll<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>[];
findAll<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>[];
findAll<T extends Element>(selector: string): DOMWrapper<T>[];
findAll(selector: string): DOMWrapper<Element>[];
findComponent<T extends never>(selector: string): WrapperLike;
findComponent<T extends DefinedComponent>(selector: T | Exclude<FindComponentSelector, FunctionalComponent>): VueWrapper<InstanceType<T>>;
findComponent<T extends FunctionalComponent>(selector: T | string): DOMWrapper<Element>;
findComponent<T extends never>(selector: NameSelector | RefSelector): VueWrapper;
findComponent<T extends ComponentPublicInstance>(selector: T | FindComponentSelector): VueWrapper<T>;
findComponent(selector: FindComponentSelector): WrapperLike;
findAllComponents<T extends never>(selector: string): WrapperLike[];
findAllComponents<T extends DefinedComponent>(selector: T | Exclude<FindAllComponentsSelector, FunctionalComponent>): VueWrapper<InstanceType<T>>[];
findAllComponents<T extends FunctionalComponent>(selector: string): DOMWrapper<Element>[];
findAllComponents<T extends FunctionalComponent>(selector: T): DOMWrapper<Node>[];
findAllComponents<T extends never>(selector: NameSelector): VueWrapper[];
findAllComponents<T extends ComponentPublicInstance>(selector: T | FindAllComponentsSelector): VueWrapper<T>[];
findAllComponents(selector: FindAllComponentsSelector): WrapperLike[];
get<K extends keyof HTMLElementTagNameMap>(selector: K): Omit<DOMWrapper<HTMLElementTagNameMap[K]>, 'exists'>;
get<K extends keyof SVGElementTagNameMap>(selector: K): Omit<DOMWrapper<SVGElementTagNameMap[K]>, 'exists'>;
get<T extends Element = Element>(selector: string): Omit<DOMWrapper<T>, 'exists'>;
get<T extends Node = Node>(selector: string | RefSelector): Omit<DOMWrapper<T>, 'exists'>;
getComponent<T extends never>(selector: string): Omit<WrapperLike, 'exists'>;
getComponent<T extends DefinedComponent>(selector: T | Exclude<FindComponentSelector, FunctionalComponent>): Omit<VueWrapper<InstanceType<T>>, 'exists'>;
getComponent<T extends FunctionalComponent>(selector: T | string): Omit<DOMWrapper<Element>, 'exists'>;
getComponent<T extends ComponentPublicInstance>(selector: T | FindComponentSelector): Omit<VueWrapper<T>, 'exists'>;
getComponent<T extends never>(selector: FindComponentSelector): Omit<WrapperLike, 'exists'>;
html(): string;
classes(): string[];
classes(className: string): boolean;
classes(className?: string): string[] | boolean;
attributes(): {
[key: string]: string;
};
attributes(key: string): string | undefined;
attributes(key?: string): {
[key: string]: string;
} | string | undefined;
text(): string;
exists(): boolean;
setValue(value: any): Promise<void>;
isVisible(): boolean;
trigger(eventString: DomEventNameWithModifier, options?: TriggerOptions): Promise<void>;
trigger(eventString: string, options?: TriggerOptions): Promise<void>;
}

23
node_modules/@vue/test-utils/dist/mount.d.ts generated vendored Normal file
View File

@@ -0,0 +1,23 @@
import { ComponentPublicInstance, DefineComponent, VNode } from 'vue';
import type { ComponentExposed, ComponentProps, ComponentSlots } from 'vue-component-type-helpers';
import { MountingOptions } from './types';
import { VueWrapper } from './vueWrapper';
type ShimSlotReturnType<T> = T extends (...args: infer P) => any ? (...args: P) => any : never;
type WithArray<T> = T | T[];
type ComponentData<T> = T extends {
data?(...args: any): infer D;
} ? D : {};
export type ComponentMountingOptions<T, P extends ComponentProps<T> = ComponentProps<T>> = Omit<MountingOptions<P, ComponentData<T>>, 'slots'> & {
slots?: {
[K in keyof ComponentSlots<T>]: WithArray<ShimSlotReturnType<ComponentSlots<T>[K]> | string | VNode | (new () => any) | {
template: string;
}>;
};
} & Record<string, unknown>;
export declare function mount<T, C = T extends ((...args: any) => any) | (new (...args: any) => any) ? T : T extends {
props?: infer Props;
} ? DefineComponent<Props extends Readonly<(infer PropNames)[]> | (infer PropNames)[] ? {
[key in PropNames extends string ? PropNames : string]?: any;
} : Props> : DefineComponent, P extends ComponentProps<C> = ComponentProps<C>>(originalComponent: T, options?: ComponentMountingOptions<C, P>): VueWrapper<ComponentProps<C> & ComponentData<C> & ComponentExposed<C>, ComponentPublicInstance<ComponentProps<C>, ComponentData<C> & ComponentExposed<C> & Omit<P, keyof ComponentProps<C>>>>;
export declare const shallowMount: typeof mount;
export {};

View File

@@ -0,0 +1,8 @@
import { DefineComponent } from 'vue';
import { ComponentMountingOptions } from './mount';
import { RenderMountingOptions } from './types';
export declare function renderToString<T, C = T extends ((...args: any) => any) | (new (...args: any) => any) ? T : T extends {
props?: infer Props;
} ? DefineComponent<Props extends Readonly<(infer PropNames)[]> | (infer PropNames)[] ? {
[key in PropNames extends string ? PropNames : string]?: any;
} : Props> : DefineComponent>(originalComponent: T, options?: ComponentMountingOptions<C> & Pick<RenderMountingOptions<any>, 'attachTo'>): Promise<string>;

6
node_modules/@vue/test-utils/dist/stubs.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import { Component } from 'vue';
export declare function registerStub({ source, stub }: {
source: Component;
stub: Component;
}): void;
export declare function getOriginalComponentFromStub(stub: Component): Component | undefined;

146
node_modules/@vue/test-utils/dist/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,146 @@
import { Component, ComponentOptions, Directive, Plugin, AppConfig, VNode, VNodeProps, FunctionalComponent, ComponentInternalInstance, Ref } from 'vue';
export interface RefSelector {
ref: string;
}
export interface NameSelector {
name: string;
length?: never;
}
export type FindAllComponentsSelector = DefinedComponent | FunctionalComponent | ComponentOptions | NameSelector | string;
export type FindComponentSelector = RefSelector | FindAllComponentsSelector;
export type Slot = VNode | string | {
render: Function;
} | Function | Component;
type SlotDictionary = {
[key: string]: Slot;
};
type RawProps = VNodeProps & {
__v_isVNode?: never;
[Symbol.iterator]?: never;
} & Record<string, any>;
interface BaseMountingOptions<Props, Data = {}> {
/**
* Overrides component's default data. Must be a function.
* @see https://test-utils.vuejs.org/api/#data
*/
data?: () => {} extends Data ? any : Data extends object ? Partial<Data> : any;
/**
* Sets component props when mounted.
* @see https://test-utils.vuejs.org/api/#props
*/
props?: (RawProps & Props) | ({} extends Props ? null : never);
/**
* @deprecated use `props` instead.
*/
propsData?: Props;
/**
* Sets component attributes when mounted.
* @see https://test-utils.vuejs.org/api/#attrs
*/
attrs?: Record<string, unknown>;
/**
* Provide values for slots on a component.
* @see https://test-utils.vuejs.org/api/#slots
*/
slots?: SlotDictionary & {
default?: Slot;
};
/**
* Provides global mounting options to the component.
*/
global?: GlobalMountOptions;
/**
* Automatically stub out all the child components.
* @default false
* @see https://test-utils.vuejs.org/api/#slots
*/
shallow?: boolean;
}
/**
* Mounting options for `mount` and `shallowMount`
*/
export interface MountingOptions<Props, Data = {}> extends BaseMountingOptions<Props, Data> {
/**
* Specify where to mount the component.
* Can be a valid CSS selector, or an Element connected to the document.
* @see https://test-utils.vuejs.org/api/#attachto
*/
attachTo?: Element | string;
}
/**
* Mounting options for `renderToString`
*/
export interface RenderMountingOptions<Props, Data = {}> extends BaseMountingOptions<Props, Data> {
/**
* Attach to is not available in SSR mode
*/
attachTo?: never;
}
export type Stub = boolean | Component | Directive;
export type Stubs = Record<string, Stub> | Array<string>;
export type GlobalMountOptions = {
/**
* Installs plugins on the component.
* @see https://test-utils.vuejs.org/api/#global-plugins
*/
plugins?: (Plugin | [Plugin, ...any[]])[];
/**
* Customizes Vue application global configuration
* @see https://v3.vuejs.org/api/application-config.html#application-config
*/
config?: Partial<Omit<AppConfig, 'isNativeTag'>>;
/**
* Applies a mixin for components under testing.
* @see https://test-utils.vuejs.org/api/#global-mixins
*/
mixins?: ComponentOptions[];
/**
* Mocks a global instance property.
* This is designed to mock variables injected by third party plugins, not
* Vue's native properties such as $root, $children, etc.
* @see https://test-utils.vuejs.org/api/#global-mocks
*/
mocks?: Record<string, any>;
/**
* Provides data to be received in a setup function via `inject`.
* @see https://test-utils.vuejs.org/api/#global-provide
*/
provide?: Record<any, any>;
/**
* Registers components globally for components under testing.
* @see https://test-utils.vuejs.org/api/#global-components
*/
components?: Record<string, Component | object>;
/**
* Registers a directive globally for components under testing
* @see https://test-utils.vuejs.org/api/#global-directives
*/
directives?: Record<string, Directive>;
/**
* Stubs a component for components under testing.
* @default "{ transition: true, 'transition-group': true }"
* @see https://test-utils.vuejs.org/api/#global-stubs
*/
stubs?: Stubs;
/**
* Allows rendering the default slot content, even when using
* `shallow` or `shallowMount`.
* @default false
* @see https://test-utils.vuejs.org/api/#global-renderstubdefaultslot
*/
renderStubDefaultSlot?: boolean;
};
export type VueNode<T extends Node = Node> = T & {
__vue_app__?: any;
__vueParentComponent?: ComponentInternalInstance;
};
export type VueElement = VueNode<Element>;
export type DefinedComponent = new (...args: any[]) => any;
/**
* T is a DeepRef if:
* - It's a Ref itself
* - It's an array containing a ref at any level
* - It's an object containing a ref at any level
*/
export type DeepRef<T> = T extends Ref<T> ? T : T extends object ? DeepRef<T> : Ref<T>;
export {};

27
node_modules/@vue/test-utils/dist/utils.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
import { GlobalMountOptions, RefSelector, Stub, Stubs } from './types';
import { Component, ComponentOptions, ComponentPublicInstance, ConcreteComponent, Directive, FunctionalComponent } from 'vue';
export declare function mergeGlobalProperties(mountGlobal?: GlobalMountOptions): Required<GlobalMountOptions>;
export declare const isObject: (obj: unknown) => obj is Record<string, any>;
export declare const mergeDeep: (target: Record<string, unknown>, source: Record<string, unknown>) => Record<string, unknown>;
export declare function isClassComponent(component: unknown): boolean;
export declare function isComponent(component: unknown): component is ConcreteComponent;
export declare function isFunctionalComponent(component: unknown): component is FunctionalComponent;
export declare function isObjectComponent(component: unknown): component is ComponentOptions;
export declare function textContent(element: Node): string;
export declare function hasOwnProperty<O extends {}, P extends PropertyKey>(obj: O, prop: P): obj is O & Record<P, unknown>;
export declare function isNotNullOrUndefined<T extends {}>(obj: T | null | undefined): obj is T;
export declare function isRefSelector(selector: string | RefSelector): selector is RefSelector;
export declare function convertStubsToRecord(stubs: Stubs): Record<string, Stub>;
export declare function getComponentsFromStubs(stubs: Stubs): Record<string, Component | boolean>;
export declare function getDirectivesFromStubs(stubs: Stubs): Record<string, Directive | true>;
export declare function hasSetupState(vm: ComponentPublicInstance): vm is ComponentPublicInstance & {
$: {
setupState: Record<string, unknown>;
};
};
export declare function isScriptSetup(vm: ComponentPublicInstance): vm is ComponentPublicInstance & {
$: {
setupState: Record<string, unknown>;
};
};
export declare const getGlobalThis: () => any;

View File

@@ -0,0 +1,5 @@
import { ComponentPublicInstance } from 'vue';
import type { VueWrapper } from '../vueWrapper';
export declare function disableAutoUnmount(): void;
export declare function enableAutoUnmount(hook: (callback: () => void) => void): void;
export declare function trackInstance(wrapper: VueWrapper<ComponentPublicInstance>): void;

View File

@@ -0,0 +1,2 @@
import * as vue from 'vue';
export declare function processSlot(source?: string, Vue?: typeof vue): (ctx?: {}) => any;

View File

@@ -0,0 +1,3 @@
import { ComponentInternalInstance, VNodeTypes } from 'vue';
export declare const getComponentRegisteredName: (instance: ComponentInternalInstance | null, type: VNodeTypes) => string | null;
export declare const getComponentName: (instance: any | null, type: VNodeTypes) => string;

10
node_modules/@vue/test-utils/dist/utils/find.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import { ComponentInternalInstance, VNode } from 'vue';
import { FindAllComponentsSelector } from '../types';
/**
* Detect whether a selector matches a VNode
* @param node
* @param selector
* @return {boolean | ((value: any) => boolean)}
*/
export declare function matches(node: VNode, rawSelector: FindAllComponentsSelector): boolean;
export declare function find(root: VNode, selector: FindAllComponentsSelector): ComponentInternalInstance[];

View File

@@ -0,0 +1 @@
export declare function flushPromises(): Promise<unknown>;

View File

@@ -0,0 +1,2 @@
import { VNode } from 'vue';
export declare function getRootNodes(vnode: VNode): Node[];

11
node_modules/@vue/test-utils/dist/utils/isDeepRef.d.ts generated vendored Normal file
View File

@@ -0,0 +1,11 @@
import type { DeepRef } from '../types';
/**
* Checks if the given value is a DeepRef.
*
* For both arrays and objects, it will recursively check
* if any of their values is a Ref.
*
* @param {DeepRef<T> | unknown} r - The value to check.
* @returns {boolean} Returns true if the value is a DeepRef, false otherwise.
*/
export declare const isDeepRef: <T>(r: DeepRef<T> | unknown) => r is DeepRef<T>;

View File

@@ -0,0 +1 @@
export declare function isElement(element: Node): element is Element;

View File

@@ -0,0 +1,6 @@
/*!
* isElementVisible
* Adapted from https://github.com/testing-library/jest-dom
* Licensed under the MIT License.
*/
export declare function isElementVisible<T extends Element>(element: T): boolean;

View File

@@ -0,0 +1 @@
export declare function matchName(target: string, sourceName: string): boolean;

View File

@@ -0,0 +1 @@
export declare function stringifyNode(node: Node): string;

View File

@@ -0,0 +1,8 @@
import type { ComponentOptions } from 'vue';
export declare function isLegacyExtendedComponent(component: unknown): component is {
(): Function;
super: Function;
options: ComponentOptions;
};
export declare function unwrapLegacyVueExtendComponent<T>(selector: T): T | ComponentOptions;
export declare function isLegacyFunctionalComponent(component: unknown): boolean;

16
node_modules/@vue/test-utils/dist/utils/vueShared.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
export declare const camelize: (str: string) => string;
export declare const capitalize: (str: string) => string;
export declare const hyphenate: (str: string) => string;
export declare const enum ShapeFlags {
ELEMENT = 1,
FUNCTIONAL_COMPONENT = 2,
STATEFUL_COMPONENT = 4,
TEXT_CHILDREN = 8,
ARRAY_CHILDREN = 16,
SLOTS_CHILDREN = 32,
TELEPORT = 64,
SUSPENSE = 128,
COMPONENT_SHOULD_KEEP_ALIVE = 256,
COMPONENT_KEPT_ALIVE = 512,
COMPONENT = 6
}

View File

@@ -0,0 +1,31 @@
import { VTUVNodeTypeTransformer } from './util';
import { Teleport, KeepAlive, VNodeTypes, ConcreteComponent, Component } from 'vue';
export type CustomCreateStub = (params: {
name: string;
component: ConcreteComponent;
registerStub: (config: {
source: Component;
stub: Component;
}) => void;
}) => ConcreteComponent;
interface StubOptions {
name: string;
type?: VNodeTypes | typeof Teleport | typeof KeepAlive;
renderStubDefaultSlot?: boolean;
}
export declare const createStub: ({ name, type, renderStubDefaultSlot }: StubOptions) => import("vue").DefineComponent<any, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<any>, {} | {
[x: string]: any;
}, {}>;
export interface CreateStubComponentsTransformerConfig {
rootComponents: {
component?: Component;
functional?: Component;
};
stubs?: Record<string, Component | boolean>;
shallow?: boolean;
renderStubDefaultSlot: boolean;
}
export declare function createStubComponentsTransformer({ rootComponents, stubs, shallow, renderStubDefaultSlot }: CreateStubComponentsTransformerConfig): VTUVNodeTypeTransformer;
export {};

View File

@@ -0,0 +1,7 @@
import { Directive } from 'vue';
import type { VTUVNodeTypeTransformer } from './util';
interface CreateDirectivesTransformerConfig {
directives: Record<string, Directive | true>;
}
export declare function createStubDirectivesTransformer({ directives }: CreateDirectivesTransformerConfig): VTUVNodeTypeTransformer;
export {};

View File

@@ -0,0 +1,21 @@
import { Component, ConcreteComponent, transformVNodeArgs } from 'vue';
type VNodeArgsTransformerFn = NonNullable<Parameters<typeof transformVNodeArgs>[0]>;
type TransformVNodeArgs = Parameters<VNodeArgsTransformerFn>;
type VNodeTransformerArgsType = TransformVNodeArgs[0];
type InstanceArgsType = TransformVNodeArgs[1];
type VNodeTransformerInputType = VNodeTransformerArgsType[0];
type ExtractComponentTypes<T> = T extends ConcreteComponent ? T : never;
type VNodeTransformerInputComponentType = ExtractComponentTypes<VNodeTransformerInputType>;
export type VTUVNodeTypeTransformer = (inputType: VNodeTransformerInputComponentType, instance: InstanceArgsType) => VNodeTransformerInputComponentType;
export declare const isTeleport: (type: any) => boolean;
export declare const isKeepAlive: (type: any) => boolean;
export interface RootComponents {
component?: Component;
functional?: Component;
}
export declare const isRootComponent: (rootComponents: RootComponents, type: VNodeTransformerInputComponentType, instance: InstanceArgsType) => boolean;
export declare const createVNodeTransformer: ({ rootComponents, transformers }: {
rootComponents: RootComponents;
transformers: VTUVNodeTypeTransformer[];
}) => VNodeArgsTransformerFn;
export {};

File diff suppressed because it is too large Load Diff

8509
node_modules/@vue/test-utils/dist/vue-test-utils.cjs.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

32
node_modules/@vue/test-utils/dist/vueWrapper.d.ts generated vendored Normal file
View File

@@ -0,0 +1,32 @@
import { App, ComponentPublicInstance } from 'vue';
import { VueNode } from './types';
import BaseWrapper from './baseWrapper';
import type { DOMWrapper } from './domWrapper';
export declare class VueWrapper<VM = unknown, T extends ComponentPublicInstance = VM & ComponentPublicInstance> extends BaseWrapper<Node> {
private readonly componentVM;
private readonly rootVM;
private readonly __app;
private readonly __setProps;
private cleanUpCallbacks;
constructor(app: App | null, vm: T, setProps?: (props: Record<string, unknown>) => void);
private get hasMultipleRoots();
protected getRootNodes(): VueNode[];
private get parentElement();
getCurrentComponent(): import("vue").ComponentInternalInstance;
exists(): boolean;
findAll<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>[];
findAll<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>[];
findAll<T extends Element>(selector: string): DOMWrapper<T>[];
private attachNativeEventListener;
get element(): T['$el'];
get vm(): T;
props(): T['$props'];
props<Selector extends keyof T['$props']>(selector: Selector): T['$props'][Selector];
emitted<T = unknown>(): Record<string, T[]>;
emitted<T = unknown[]>(eventName: string): undefined | T[];
isVisible(): boolean;
setData(data: Record<string, unknown>): Promise<void>;
setProps(props: Partial<T['$props']>): Promise<void>;
setValue(value: unknown, prop?: string): Promise<void>;
unmount(): void;
}

14
node_modules/@vue/test-utils/dist/wrapperFactory.d.ts generated vendored Normal file
View File

@@ -0,0 +1,14 @@
import { ComponentPublicInstance, App } from 'vue';
import type { DOMWrapper as DOMWrapperType } from './domWrapper';
import type { VueWrapper as VueWrapperType } from './vueWrapper';
export declare enum WrapperType {
DOMWrapper = 0,
VueWrapper = 1
}
type DOMWrapperFactory = <T extends Node>(element: T | null | undefined) => DOMWrapperType<T>;
type VueWrapperFactory = <T extends ComponentPublicInstance>(app: App | null, vm: T, setProps?: (props: Record<string, unknown>) => Promise<void>) => VueWrapperType<T>;
export declare function registerFactory(type: WrapperType.DOMWrapper, fn: DOMWrapperFactory): void;
export declare function registerFactory(type: WrapperType.VueWrapper, fn: VueWrapperFactory): void;
export declare const createDOMWrapper: DOMWrapperFactory;
export declare const createVueWrapper: VueWrapperFactory;
export {};