test-utils

Vue Test Utils for Vue 3

MIT License

Downloads
7.2M
Stars
1K
Committers
156

Bot releases are hidden (Show)

test-utils - v2.0.0-beta.4

Published by lmiller1990 about 4 years ago

Fixes

  • swallow warning for emitted events introduced by Vue rc.10
  • fix(mount): mount should accept a partial config
  • fix: make get() return type adhering to its return type
test-utils - v2.0.0-beta.3

Published by lmiller1990 about 4 years ago

Fixes

test-utils - v2.0.0-beta.2

Published by lmiller1990 about 4 years ago

Features

This release is what was supposed to be v2.0.0-beta.1. There was a caching issue where some changes were not published. See release notes for v2.0.0-beta.1.

test-utils - v2.0.0-beta.1

Published by lmiller1990 about 4 years ago

Features

Also, highly recommend updating your vue-jest version to 5.0.0-alpha.2. You can now get started with Vue 3 + test utils with the Vue-CLI!

test-utils - v2.0.0-beta.0

Published by lmiller1990 over 4 years ago

Features

  • export a flushPromises utility
test-utils - 2.0.0-alpha.8

Published by lmiller1990 over 4 years ago

Features

  • Vue beta 16 comparability by @cexbrayat
test-utils - 2.0.0-alpha.7

Published by lmiller1990 over 4 years ago

Features

  • Various typing improvements by @cexbrayat, @pikax
  • Improve typings for emitted @lmiller1990
  • Support Vue 3 beta 15 @cexbrayat

Refactors

  • rename setModelValue to setValue #133 @dobromir-hristov
  • improve tests by @afontcu

Improvements

  • improve readme @cnschwarz
  • remove @vue/compiler-sfc as peer dependency @sodatea
test-utils - 2.0.0-alpha.6

Published by lmiller1990 over 4 years ago

Fixes

  • inline @vue/shared to improve es module experience (#121, @JessicaSachs)
test-utils - 2.0.0-alpha.5

Published by lmiller1990 over 4 years ago

Features:

  • Implement Scoped Slot string support (#115, @dobromir-hristov)

Fixes

  • esm build no longer relies on cjs modules. You can now use VTU as an es module in a browser directly. Try it with Vite - it's great! (#116, @lmiller1990)
  • fix config.global.stubs to work correctly (#116, @lmiller1990)
  • allow mounting functional components (#118, @dobromir-hristov)
test-utils - 2.0.0-alpha.4

Published by lmiller1990 over 4 years ago

Features

  • do not mount on body/clear body every test @pikax
  • allow rendering all slots of a stub via config.renderStubDefaultSlot @dobromir-hristov
  • split attrs and props mounting options @cexbrayat
  • shallowmounting option (previously shallowMount) @dobromir-hristov
    • shallowMount function is still exported, but shallow mounting option is recommended
  • export DOMWrapper @lmiller1990

Fixes

fix: improve error message for getComponent by @cexbrayat

Other

  • lots of general improvements to various types
test-utils - 2.0.0-alpha.3

Published by lmiller1990 over 4 years ago

Features

  • attachTo: see docs. thanks to our boy @pikax
  • add a browser build. Thanks to me!
  • getComponent. Like get but for component instances. Throws an error if no instance is found. Note: Has a bug where doesn't work with children of <Suspense> by @cexbrayat!
  • plugin feature! you can add your own methods easily. Docs are a WIP, see them here. It's really cool. by @JessicaSachs!

Bugfixes

  • fix: emit should propagate the event @cexbrayat

General Improvements

  • improve stubs, findComponent, improved test coverage @dobromir-hristov!
  • better type definitions and type tests with tds @cexbrayat
test-utils - 2.0.0-alpha-2

Published by lmiller1990 over 4 years ago

Features:

  • Support passing an array to stubs
  • Support mocks
  • Support props()
  • Support findComponent and findAllComponents to query for Vue components
    • findComponent(Foo)
    • findComponent({ ref: 'foo' })
    • findComponent({ name: 'foo' })
    • like in VTU beta
  • Support unmount method (destroy from VTU beta)
    • renamed to match Vue 3 API
  • Support setProps
  • Improve trigger to match VTU beta API
    • wrapper.trigger('keyup.enter', { keycode: 45 })
    • wrapper.trigger('click', { target: 'something' })
    • etc. Same as VTU beta.

Breaking Changes (from alpha-1)

  • stubs, mocks are now in a globals key:
mount(Foo, {
  globals: {
    stubs: {
      ...
    }
  }
}

You can read the full API in the docs

test-utils - 2.0.0-alpha-1

Published by lmiller1990 over 4 years ago

First public alpha. Includes basic features as listed in the README at the time of release.