包详细信息

@gavajs/vue

VSymonenko627MIT0.3.0

Vue unit test

vue, vue3, unit, test

自述文件

Gava.js Vue

Library for Vue.js 3 projects

Usage

Use for unit testing with any test runner.

Mount component

import { mount } from '@gavajs/vue';

const instance = mount(Component);

The mount function have input interface the same with Vue render function. And return ComponentPublicInstance

// short signature
// with props
function mount(type: string | Component, props?: object): ComponentPublicInstance;
// or with children
function mount(type: string | Component, children?: Children): ComponentPublicInstance;
type Children = string | number | boolean | VNode | null | Children[];
// or with slot
function mount(type: string | Component, slot?: () => Children): ComponentPublicInstance;
// or with named slots
function mount(type: string | Component, slots: { [name: string]: Slot }): ComponentPublicInstance;
// long signature
function mount(
  type: string | Component,
  props?: object | null,
  children?: Children | Slot | Slots
): ComponentPublicInstance