Testing Library

Testing Library

  • Docs
  • Recipes
  • Help
  • Blog

›Vue Testing Library

Getting Started

  • Introduction
  • Guiding Principles

Frameworks

    DOM Testing Library

    • Introduction
    • Install
    • Example
    • Setup
    • Queries
    • Firing Events
    • Async Utilities
    • Helpers
    • Configuration
    • FAQ
    • Cheatsheet

    React Testing Library

    • Introduction
    • Example
    • Setup
    • API
    • FAQ
    • Cheatsheet

    ReasonReact Testing Library

    • Introduction
    • Examples

    Native Testing Library

    • Intro
    • Example
    • Setup
    • API

    Vue Testing Library

    • Intro
    • Examples
    • Setup
    • API
  • Cypress Testing Library
  • Svelte Testing Library
  • Angular Testing Library
  • Puppeteer Testing Library
  • Testcafe Testing Library

Ecosystem

  • user-event
  • jest-dom
  • bs-jest-dom
  • jest-native
  • react-select-event
Edit

Setup

Vue Testing Library does not require any configuration to be used.

However, there are some things you can do when configuring your testing framework to reduce some boilerplate. In these docs we'll demonstrate configuring Jest.

Global Config

Adding options to your global test config can simplify the setup and teardown of tests in individual files.

Cleanup

You can ensure cleanup is called after each test and import additional assertions by adding it to the setup configuration in Jest.

In Jest 24 and up, add the setupFilesAfterEnv option to your Jest config:

// jest.config.js
module.exports = {
  setupFilesAfterEnv: ['@testing-library/vue/cleanup-after-each'],
}
Last updated on 6/1/2019
← ExamplesAPI →
  • Global Config
    • Cleanup
Testing Library
Docs
Getting StartedExamplesAPIHelp
Community
BlogStack OverflowReactiflux on DiscordSpectrum
More
StarGitHubEdit Docs on GitHub
Copyright © 2018-2019 Kent C. Dodds and contributors