компонент падает в ошибку
                  
                  
                   _ctx.$t is not a function
                  
                  
                  Код:
                  
                  
                  describe('AppHeader', () => {
                  
                  
                    const $t = () => 'Print';
                  
                  
                  
                  
                  
                    const wrapper = shallowMount(AppHeader, {
                  
                  
                      global: {
                  
                  
                        mocks: {
                  
                  
                          $t,
                  
                  
                        },
                  
                  
                      },
                  
                  
                    });
                  
                  
                  
                  
                  
                    it('component is truthy', () => {
                  
                  
                     expect(AppHeader).toBeTruthy();
                  
                  
                    });
                  
                  
                  
                  
                  
                    it('renders print-button properly', () => {
                  
                  
                      expect(wrapper.text()).toContain('Print');
                  
                  
                      expect(wrapper.getComponent(IconPrint));
                  
                  
                    });
                  
                  
                   // ...
                  
                  
                  });
                  
                  
                  Подскажите, как лечить?
                  
                  
                
а что ха $t ?
Обсуждают сегодня