E
E
Egor Astreiko2021-12-03 22:18:58
Vue.js
Egor Astreiko, 2021-12-03 22:18:58

Why doesn't jest test pass in nuxt.js?

Hello.
Started learning component testing in nuxt.js project (jest, @vue/test-utils, wallaby.js).
So I’m sure that the question will be simple for knowledgeable people, I’ll say right away that I was looking for the answer in Google, but it didn’t help me, but only confused me more.
I ran into this problem:

'AppNavigation' component

61aa69d3ea61b623761665.png

Test

61aa69f73ac12273039440.png

Result in wallaby.js output

61aa6a1b46b56888806802.png

Tried like this:
.toContain('<nav class="app-navigation">\n\t<ul class="app-navigation__list"></ul>\n</nav>')
unsuccessfully...

At the same time, if the 'AppNavigation' component is left with only a block and the same line is written in , then the test is successfully executed. What am I doing wrong? Thanks in advance. <nav class="app-navigation"></nav>.toContain('<nav class="app-navigation"></nav>')

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question