Mastering Development

Property ‘toBeInTheDocument’ does not exist on type ‘Matchers

Trying to setup testing for a components library. I’ve tried many example and all similar threads on this with no luck. My setupTests.ts file is correctly being loaded (proven with a console.log), and the library seems to be available as if I add import { toBeInTheDocument } from ‘@testing-library/jest-dom/matchers’ and log toBeInTheDocument it is present. […]


Nuxt TypeScript error: nuxt:typescript Cannot find module ‘@/my-module’

I have setup Nuxt with TypeScript using the instructions from The transition was pretty seamless and ok, except that I can’t get rid of this error that nuxt:typescript “Cannot find module”, which obviously is a false-positive. My imports look like this: import InputField from ‘@/components/InputField.vue’ I have tried with ~/ and without the .vue […]

Development Vue

How to configure Jest added to an app via Vue cli 3?

I’m trying to introduce testing with Jest into an app build with Vue. I’ve run vue add unit-jest and similarly to what testing single file components with Jest guide suggests, created the following simple test file (Paginator.spec.js in the same folder as Paginator.vue, that is /src/components): import { mount } from ‘@vue/test-utils’ import Paginator from […]