Custom Jest matchers for testing Vue components with @vue/test-utils (v1.x). Current version 2.0.1 supports Vue 2. Provides expressive matchers like toBeAScopedSlot, toBeADisabledButton, and toHaveBeenEmitted for common UI assertions. Less actively maintained since Vue 3 adoption; peer dependency on @vue/test-utils ^1.0.0-beta.20 and Jest >=23.0. Limited to Vue 2 projects.
npm install jest-matcher-vue-test-utilsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to extend Jest with a single matcher and use it on a Vue wrapper element.
For Vue 3, use '@testing-library/vue' or custom matchers; this library is Vue 2 only.
Use wrapper.find(...).attributes() or wrapper.emitted() directly.
Call expect.extend({ ... }) or import 'jest-matcher-vue-test-utils' in setup file.Update import paths: from 'jest-matcher-vue-test-utils/extend' to direct imports.
Add import 'jest-matcher-vue-test-utils' or expect.extend({ toBeADisabledButton }) in your test setup.Run npm install --save-dev @vue/test-utils@^1.0.0-beta.20
Downgrade to Vue 2 and @vue/test-utils v1, or use a different testing library.