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:

Vue logo over a brown background.

A guide to two-way binding in Vue

Learn how to implement one-way and two-way data binding in Vue.js, using v-model and advanced techniques like defineModel for better apps.

David Omotayo
Nov 22, 2024 â‹… 10 min read
TypeScript logo over a pink and white background.

Drizzle vs. Prisma: Which ORM is best for your project?

Compare Prisma and Drizzle ORMs to learn their differences, strengths, and weaknesses for data access and migrations.

Temitope Oyedele
Nov 21, 2024 â‹… 10 min read
Practical Implementation Of The Rule Of Least Power For Developers

Practical implementation of the Rule of Least Power for developers

It’s easy for devs to default to JavaScript to fix every problem. Let’s use the RoLP to find simpler alternatives with HTML and CSS.

Timonwa Akintokun
Nov 21, 2024 â‹… 8 min read
Rust logo over black marble background.

Handling memory leaks in Rust

Learn how to manage memory leaks in Rust, avoid unsafe behavior, and use tools like weak references to ensure efficient programs.

Ukeje Goodness
Nov 20, 2024 â‹… 4 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