Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should report error to sentry', async () => {
console.error = jest.fn();
reportErrorToSentry.mockClear();
const error = new Error('Oops');
const { getByText } = renderApp(
,
{
mocks: [
{
request: {
query: FetchApplicationsMenu,
},
error,
},
],
beforeEach(() => {
reportErrorToSentry.mockClear();
props = createTestProps();
wrapper = shallow()
.find(FetchUser)
.renderProp('children')(userData);
});
it('should pass "user" to ', () => {
beforeEach(() => {
reportErrorToSentry.mockClear();
wrapper.instance().componentDidMount();
});
it('should report the error to sentry', () => {
beforeEach(() => {
reportErrorToSentry.mockClear();
wrapper.instance().componentDidMount();
});
it('should report the error to sentry', () => {
beforeEach(() => {
reportErrorToSentry.mockClear();
});
describe('with `error`', () => {
beforeEach(() => {
xhrMock.setup();
mockSuperfluousRequests();
window.localStorage.setItem.mockClear();
window.localStorage.getItem.mockClear();
window.localStorage.removeItem.mockClear();
window.location.replace = jest.fn();
reportErrorToSentry.mockClear();
selectProjectKeyFromUrl.mockClear();
window.localStorage.getItem.mockImplementation(key => {
switch (key) {
case STORAGE_KEYS.IS_AUTHENTICATED:
return 'true';
case STORAGE_KEYS.ACTIVE_PROJECT_KEY:
return null;
default:
return null;
}
});
});
afterEach(() => {