2022-11-15
1793
#nuxtjs#vue
Raphael Ugwu
28129
Nov 15, 2022 â‹… 6 min read

Component testing in Nuxt.js with Jest

Raphael Ugwu Writer, software engineer, and a lifelong student.

Recent posts:

JavaScript Dictionary

JavaScript dictionary: How to use objects and maps for key-value pairs

Learn how to use JavaScript dictionaries with Objects and Maps. Discover key differences, performance insights, and best use cases with practical examples.

Elijah Agbonze
Feb 25, 2025 â‹… 9 min read
A guide to the CSS grid-template-columns property

A guide to the CSS grid-template-columns property

Take a deep dive into the CSS grid template columns property, an essential part of the CSS Grid Layout specification.

Samuel Martins
Feb 25, 2025 â‹… 15 min read
A Guide To Node.js Readable Streams

A guide to Node.js readable streams

Explore how Node.js readable streams process data in small chunks, manage data flow, handle errors, and ensure resource cleanup.

Yan Sun
Feb 25, 2025 â‹… 7 min read
Advanced React State Management Using URL Parameters

Advanced React state management using URL parameters

Manage state in React using URL parameters for better performance, SEO, and accessibility while enabling shareable and server-rendered application states.

Rahul Chhodde
Feb 24, 2025 â‹… 16 min read
View all posts

One Reply to "Component testing in Nuxt.js with Jest"

  1. Thanks for the walkthrough! Here are some things I tweaked while following along.

    – Added Vuetify so that all the `v-` components work. Easiest to do this during the `npx create-nuxt-app` step.
    – Changed the `v-flex` component to `v-col`, which I guess is the Vuetify 2.x replacement.
    – Wrapped the `v-col` in a `v-row`, both to make the layout work and because the template has to have a single root element.
    – Changed the path in `mapGetters` to `’games/consoleType’`, since the store file is `store/games.js`.
    – Likewise, removed the extra `games` from the getter paths in the tests.
    – Added the missing parenthesis to the end of the test file.
    – Removed `mode` from `jest.setup.js` – it’s for an older version of Nuxt.
    – Changed `’DOOM’` to `’Call of Duty: Black Ops 4’`, since DOOM isn’t in the store file.

Leave a Reply