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:

Leveraging React Server Components In Redwoodjs

Leveraging React Server Components in RedwoodJS

RedwoodJS announced support for server-side rendering and RSCs in its Bighorn release. Explore this feature for when it’s production-ready.

Stephan Miller
May 6, 2024 â‹… 9 min read
Exploring The Aha Stack: Astro, Htmx, Alpine — A Complete Tutorial With A Demo Project And Comparison To Other Stacks

Exploring the AHA stack: Tutorial, demo, and comparison

The AHA stack — Astro, htmx, and Alpine — is a solid web development stack for smaller apps that emphasize frontend speed and SEO.

Oyinkansola Awosan
May 3, 2024 â‹… 13 min read
Comparing Hattip Vs Express Js For Modern Application Development

Comparing Hattip vs. Express.js for modern app development

Explore what Hattip is, how it works, its benefits and key features, and the differences between Hattip and Express.js.

Antonello Zanini
May 2, 2024 â‹… 8 min read
Using React Shepherd To Build A Site Tour

Using React Shepherd to build a site tour

React Shepherd stands out as a site tour library due to its elegant UI and out-of-the-box, easy-to-use React Context implementation.

Onuorah Bonaventure
May 1, 2024 â‹… 14 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