Welcome to mirror list, hosted at ThFree Co, Russian Federation.

setup_testing_library.js « setup « test_helpers « frontend_integration « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: adc59665306de036415378dd7a2dbb5e5381e9e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { configure } from '@testing-library/dom';

const CUSTOM_ERROR_TYPE = 'TestingLibraryError';

configure({
  asyncUtilTimeout: 10000,
  // Overwrite default error message to reduce noise.
  getElementError: (messageArg) => {
    // Add to message because the `name` doesn't look like it's used (although it should).
    const message = `${CUSTOM_ERROR_TYPE}:\n\n${messageArg}`;
    const error = new Error(message);
    error.name = CUSTOM_ERROR_TYPE;
    return error;
  },
});