Я пытаюсь запустить несколько тестов с Windows10 и получаю сообщение об ошибке:
Error: Error: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 3128
at Object.dispatchError (C:\finwell-frontend\node_modules\jest-environment-jsdom-sixteen\node_modules\jsdom\lib\jsdom\living\xhr\xhr-utils.js:62:19)
at Request.<anonymous> (C:\finwell-frontend\node_modules\jest-environment-jsdom-sixteen\node_modules\jsdom\lib\jsdom\living\xhr\XMLHttpRequest-impl.js:654:18)
at Request.emit (events.js:208:15)
at Request.onRequestError (C:\finwell-frontend\node_modules\request\request.js:877:8)
at ClientRequest.emit (events.js:203:13)
at ClientRequest.onError (C:\finwell-frontend\node_modules\tunnel-agent\index.js:179:21)
at Object.onceWrapper (events.js:291:20)
at ClientRequest.emit (events.js:203:13)
at Socket.socketErrorListener (_http_client.js:399:9)
at Socket.emit (events.js:203:13) undefined
console.log src / store / session / actions. js: 147 fetchUser - > e {code: 'TIMEOUT_ERROR'}
● when a logged users is in home page › has a Service section with › update profile,withdrawal,payments,multiSimulator,premiumsplit,investmenttheme and furtherservices cards
TypeError: Cannot read property 'name' of null
14 | const { userType } = getInfoUrl();
15 | const browser = detect();
> 16 | const userAgent = `${browser.name}/${browser.version} ${browser.os}`;
| ^
17 |
18 | const lang = cookie.load('language');
19 | const error = {
at logError (src/services/api.js:16:32)
at _default (src/services/api.js:113:7)
Это мой тест:
import React from 'react';
import Home from '../Home';
import { render } from '../../utils/test-utlis';
import { fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import moxios from 'moxios';
describe('when a logged users is in home page ', () => {
let rerender;
beforeEach(async () => {
rerender = render(<Home />, {});
});
afterEach(() => {
moxios.uninstall();
});
describe('should ', () => {
it('should changes the language if the user click on a different language ', () => {
// rerender.debug();
//console.log(store.getState());
expect(rerender.queryByText('Profile')).not.toBeInTheDocument();
fireEvent.focus(rerender.container.querySelector('.Dropdown-root'));
fireEvent.mouseDown(
rerender.container.querySelector('.Dropdown-control')
);
fireEvent.click(rerender.queryByText('English'));
expect(
rerender.container.querySelector('.is-selected')
).toHaveTextContent('English');
expect(rerender.getAllByText('Profile')[0]).toBeInTheDocument();
//Return to default language(Deutsch)
fireEvent.focus(rerender.container.querySelector('.Dropdown-root'));
fireEvent.mouseDown(
rerender.container.querySelector('.Dropdown-control')
);
fireEvent.click(rerender.queryByText('Deutsch'));
});
xit('be able to go to contact and profile page ', () => {
fireEvent.click(rerender.getAllByTestId('contact-us')[0]);
expect(rerender.history.location.pathname).toEqual('/contact-us');
fireEvent.click(rerender.getAllByTestId('my-account')[0]);
expect(rerender.history.location.pathname).toEqual('/my-account');
});
it('have a Improve your pension situaton section ', () => {
expect(
rerender.getByRole('banner', { name: 'NeedsBannerDesktop' })
).toBeInTheDocument();
});
it('have a Improve your pension situaton section ', () => {
expect(
rerender.getByRole('button', { name: 'payments-home-card' })
).toBeInTheDocument();
});
});
describe('has a valid Banner with buttons to', () => {
xit('Benefits, Widthdrawal, Multiselector and Payments sections', () => {
expect(
rerender.getByRole('button', {
name: 'Übersicht über die Leistungen'
})
).toBeInTheDocument();
expect(
rerender.getByRole('button', {
name: 'Finanzierung von Wohneigentum'
})
).toBeInTheDocument();
expect(
rerender.getByRole('button', { name: 'Pensionierung planen' })
).toBeInTheDocument();
expect(
rerender.getByRole('button', {
name: 'Einzahlung in die Pensionskasse'
})
).toBeInTheDocument();
});
});
describe('has a Service section with ', () => {
it('update profile,withdrawal,payments,multiSimulator,premiumsplit,investmenttheme and furtherservices cards ', () => {
expect(
rerender.getByRole('button', {
name: 'updateprofile'
})
).toBeInTheDocument();
expect(
rerender.getByRole('button', {
name: 'withdrawal'
})
).toBeInTheDocument();
expect(
rerender.getByRole('button', { name: 'paymentspensionfund' })
).toBeInTheDocument();
expect(
rerender.getByRole('button', { name: 'multiSimulator' })
).toBeInTheDocument();
expect(
rerender.getByRole('button', { name: 'premiumsplit' })
).toBeInTheDocument();
expect(
rerender.getByRole('button', { name: 'investmenttheme' })
).toBeInTheDocument();
expect(
rerender.getByRole('button', { name: 'furtherservices' })
).toBeInTheDocument();
});
});
describe('has an Improve Pension Situation section ', () => {
xit('with a link that should to go to Payments', () => {
fireEvent.click(rerender.queryByTestId('payments-home-link'));
expect(rerender.history.location.pathname).toEqual('/payments');
});
});
});
, и это происходит внезапно, пока он работает нормально, и я делаю изменения и начал сбой с этой ошибкой. Не могу понять, что происходит, прокси настроены правильно. Может ли кто-нибудь помочь мне разобраться в проблеме и как ее решить, пожалуйста? С уважением.