@vue/test-utils
Advanced tools
Comparing version 2.0.0-rc.1 to 2.0.0-rc.2
@@ -1,15 +0,6 @@ | ||
import { nextTick } from 'vue'; | ||
import { TriggerOptions } from './createDomEvent'; | ||
export declare class DOMWrapper<ElementType extends Element> { | ||
element: ElementType; | ||
import BaseWrapper from './baseWrapper'; | ||
import WrapperLike from './interfaces/wrapperLike'; | ||
export declare class DOMWrapper<ElementType extends Element> extends BaseWrapper<ElementType> implements WrapperLike { | ||
constructor(element: ElementType); | ||
classes(): string[]; | ||
classes(className: string): boolean; | ||
attributes(): { | ||
[key: string]: string; | ||
}; | ||
attributes(key: string): string; | ||
exists(): boolean; | ||
isVisible(): boolean; | ||
text(): string; | ||
html(): string; | ||
@@ -19,5 +10,5 @@ find<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>; | ||
find<T extends Element>(selector: string): DOMWrapper<T>; | ||
get<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>; | ||
get<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>; | ||
get<T extends Element>(selector: string): DOMWrapper<T>; | ||
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>(selector: string): Omit<DOMWrapper<T>, 'exists'>; | ||
findAll<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>[]; | ||
@@ -27,5 +18,4 @@ findAll<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>[]; | ||
private setChecked; | ||
setValue(value?: any): Promise<typeof nextTick | undefined> | undefined; | ||
setValue(value?: any): Promise<void>; | ||
private setSelected; | ||
trigger(eventString: string, options?: TriggerOptions): Promise<typeof nextTick>; | ||
} |
@@ -1,3 +0,4 @@ | ||
import { ComponentPublicInstance } from 'vue'; | ||
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; |
@@ -29,3 +29,3 @@ import { Component, ComponentOptions, Directive, Plugin, AppConfig, VNode, VNodeProps } from 'vue'; | ||
* Overrides component's default data. Must be a function. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#data | ||
* @see https://next.vue-test-utils.vuejs.org/api/#data | ||
*/ | ||
@@ -35,3 +35,3 @@ data?: () => {} extends Data ? any : Data extends object ? Partial<Data> : any; | ||
* Sets component props when mounted. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#props | ||
* @see https://next.vue-test-utils.vuejs.org/api/#props | ||
*/ | ||
@@ -45,3 +45,3 @@ props?: (RawProps & Props) | ({} extends Props ? null : never); | ||
* Sets component attributes when mounted. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#attrs | ||
* @see https://next.vue-test-utils.vuejs.org/api/#attrs | ||
*/ | ||
@@ -53,3 +53,3 @@ attrs?: Record<string, unknown>; | ||
* object with a `template` key is not supported. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#slots | ||
* @see https://next.vue-test-utils.vuejs.org/api/#slots | ||
*/ | ||
@@ -66,3 +66,3 @@ slots?: SlotDictionary & { | ||
* Can be a valid CSS selector, or an Element connected to the document. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#attachto | ||
* @see https://next.vue-test-utils.vuejs.org/api/#attachto | ||
*/ | ||
@@ -73,3 +73,3 @@ attachTo?: HTMLElement | string; | ||
* @default false | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#slots | ||
* @see https://next.vue-test-utils.vuejs.org/api/#slots | ||
*/ | ||
@@ -81,3 +81,3 @@ shallow?: boolean; | ||
* Installs plugins on the component. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#plugins | ||
* @see https://next.vue-test-utils.vuejs.org/api/#global-plugins | ||
*/ | ||
@@ -92,3 +92,3 @@ plugins?: (Plugin | [Plugin, ...any[]])[]; | ||
* Applies a mixin for components under testing. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#mixins | ||
* @see https://next.vue-test-utils.vuejs.org/api/#global-mixins | ||
*/ | ||
@@ -100,3 +100,3 @@ mixins?: ComponentOptions[]; | ||
* Vue's native properties such as $root, $children, etc. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#mocks | ||
* @see https://next.vue-test-utils.vuejs.org/api/#global-mocks | ||
*/ | ||
@@ -106,3 +106,3 @@ mocks?: Record<string, any>; | ||
* Provides data to be received in a setup function via `inject`. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#provide | ||
* @see https://next.vue-test-utils.vuejs.org/api/#global-provide | ||
*/ | ||
@@ -112,3 +112,3 @@ provide?: Record<any, any>; | ||
* Registers components globally for components under testing. | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#components | ||
* @see https://next.vue-test-utils.vuejs.org/api/#global-components | ||
*/ | ||
@@ -118,3 +118,3 @@ components?: Record<string, Component | object>; | ||
* Registers a directive globally for components under testing | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#directives | ||
* @see https://next.vue-test-utils.vuejs.org/api/#global-directives | ||
*/ | ||
@@ -125,3 +125,3 @@ directives?: Record<string, Directive>; | ||
* @default "{ transition: true, 'transition-group': true }" | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#global-stubs | ||
* @see https://next.vue-test-utils.vuejs.org/api/#global-stubs | ||
*/ | ||
@@ -133,3 +133,3 @@ stubs?: Record<any, any>; | ||
* @default false | ||
* @see https://vue-test-utils.vuejs.org/v2/api/#renderstubdefaultslot | ||
* @see https://next.vue-test-utils.vuejs.org/api/#global-renderstubdefaultslot | ||
*/ | ||
@@ -136,0 +136,0 @@ renderStubDefaultSlot?: boolean; |
import { GlobalMountOptions } from './types'; | ||
export declare function mergeGlobalProperties(configGlobal?: GlobalMountOptions, mountGlobal?: GlobalMountOptions): GlobalMountOptions; | ||
export declare function mergeGlobalProperties(configGlobal?: GlobalMountOptions, mountGlobal?: GlobalMountOptions): Required<GlobalMountOptions>; | ||
export declare const mergeDeep: (target: Record<string, any>, source: Record<string, any>) => Record<string, any>; | ||
@@ -4,0 +4,0 @@ export declare function isClassComponent(component: any): any; |
@@ -1,6 +0,7 @@ | ||
import { ComponentPublicInstance, nextTick, App } from 'vue'; | ||
import { ComponentPublicInstance, App } from 'vue'; | ||
import { DOMWrapper } from './domWrapper'; | ||
import { FindAllComponentsSelector, FindComponentSelector } from './types'; | ||
import { TriggerOptions } from './createDomEvent'; | ||
export declare class VueWrapper<T extends ComponentPublicInstance> { | ||
import BaseWrapper from './baseWrapper'; | ||
import WrapperLike from './interfaces/wrapperLike'; | ||
export declare class VueWrapper<T extends ComponentPublicInstance> extends BaseWrapper<T['$el']> implements WrapperLike { | ||
private componentVM; | ||
@@ -13,2 +14,3 @@ private rootVM; | ||
private get parentElement(); | ||
private attachNativeEventListener; | ||
get element(): Element; | ||
@@ -20,13 +22,5 @@ get vm(): T; | ||
props(selector: string): any; | ||
classes(): string[]; | ||
classes(className: string): boolean; | ||
attributes(): { | ||
[key: string]: string; | ||
}; | ||
attributes(key: string): string; | ||
exists(): boolean; | ||
emitted<T = unknown>(): Record<string, T[]>; | ||
emitted<T = unknown>(eventName?: string): undefined | T[]; | ||
emitted<T = unknown>(eventName: string): undefined | T[]; | ||
html(): string; | ||
text(): string; | ||
find<K extends keyof HTMLElementTagNameMap>(selector: K): DOMWrapper<HTMLElementTagNameMap[K]>; | ||
@@ -49,5 +43,4 @@ find<K extends keyof SVGElementTagNameMap>(selector: K): DOMWrapper<SVGElementTagNameMap[K]>; | ||
setValue(value: any, prop?: string): Promise<void>; | ||
trigger(eventString: string, options?: TriggerOptions): Promise<typeof nextTick>; | ||
unmount(): void; | ||
} | ||
export declare function createWrapper<T extends ComponentPublicInstance>(app: App | null, vm: ComponentPublicInstance, setProps?: (props: Record<string, any>) => void): VueWrapper<T>; |
{ | ||
"name": "@vue/test-utils", | ||
"version": "2.0.0-rc.1", | ||
"version": "2.0.0-rc.2", | ||
"license": "MIT", | ||
@@ -15,16 +15,16 @@ "main": "dist/vue-test-utils.cjs.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.12.16", | ||
"@babel/preset-env": "^7.12.16", | ||
"@babel/core": "^7.13.1", | ||
"@babel/preset-env": "^7.13.5", | ||
"@babel/types": "^7.12.12", | ||
"@rollup/plugin-commonjs": "^17.1.0", | ||
"@rollup/plugin-json": "^4.1.0", | ||
"@rollup/plugin-node-resolve": "^11.1.1", | ||
"@rollup/plugin-replace": "^2.3.4", | ||
"@rollup/plugin-node-resolve": "^11.2.0", | ||
"@rollup/plugin-replace": "^2.4.1", | ||
"@types/jest": "26.0.20", | ||
"@types/node": "14.14.26", | ||
"@vue/compiler-sfc": "3.0.3", | ||
"@types/node": "14.14.31", | ||
"@vue/compiler-sfc": "3.0.6", | ||
"babel-jest": "^26.6.3", | ||
"babel-preset-jest": "^26.6.2", | ||
"dom-event-types": "^1.0.0", | ||
"husky": "^5.0.9", | ||
"husky": "^5.1.1", | ||
"jest": "25.5.4", | ||
@@ -36,12 +36,12 @@ "jsdom": "^16.4.0", | ||
"reflect-metadata": "^0.1.13", | ||
"rollup": "^2.38.5", | ||
"rollup-plugin-typescript2": "^0.29.0", | ||
"rollup": "^2.39.1", | ||
"rollup-plugin-typescript2": "^0.30.0", | ||
"ts-jest": "25.3.1", | ||
"tsd": "0.14.0", | ||
"typescript": "^4.1.5", | ||
"vitepress": "^0.12.0", | ||
"vue": "3.0.3", | ||
"typescript": "^4.2.2", | ||
"vitepress": "^0.12.2", | ||
"vue": "3.0.6", | ||
"vue-class-component": "^8.0.0-rc.1", | ||
"vue-jest": "^5.0.0-alpha.8", | ||
"vue-router": "^4.0.3", | ||
"vue-router": "^4.0.4", | ||
"vuex": "^4.0.0" | ||
@@ -48,0 +48,0 @@ }, |
@@ -14,3 +14,3 @@ # vue-test-utils-next | ||
We are working on [some documentation to help people migrate](https://vue-test-utils.vuejs.org/v2/guide/migration.html). | ||
We plan on work on [some documentation to help people migrate](https://next.vue-test-utils.vuejs.org/migration/). | ||
@@ -17,0 +17,0 @@ At this point you will have better luck trying this out with a brand new Vue 3 app, as opposed to upgrading an existing Vue 2 app. Feedback and bug reports are welcome! |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28
491473
13955