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:

Task Scheduling and cron Jobs in Node Using node-cron

Scheduling tasks in Node.js using node-cron

From basic syntax and advanced techniques to practical applications and error handling, here’s how to use node-cron.

Godwin Ekuma
Nov 12, 2024 â‹… 7 min read
Working With The Angular Tree: Flat Vs Nested Trees And More

Working with the Angular tree

The Angular tree view can be hard to get right, but once you understand it, it can be quite a powerful visual representation.

Lewis Cianci
Nov 12, 2024 â‹… 21 min read
Relay logo with an orange circuit-like path on a blue background, representing the Relay GraphQL client. The article covers building real-time applications in Relay 17, including features like optimistic UI updates, GraphQL subscriptions, and Relay Resolvers.

Building a real-time application with Relay 17

Build a fast, real-time app with Relay 17 to leverage features like optimistic UI updates, GraphQL subscriptions, and seamless data syncing.

Alec Brunelle
Nov 12, 2024 â‹… 9 min read
Vue.js logo over a dark, textured purple background. The article discusses using defineExpose and in Vue 3 to enhance component interaction and enable dynamic theming.

defineExpose and <style vars> in Vue 3 for component interaction and theming

Simplify component interaction and dynamic theming in Vue 3 with defineExpose and for better control and flexibility.

Clara Ekekenta
Nov 7, 2024 â‹… 8 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