Commit 74e339c1 authored by Mark Florian's avatar Mark Florian

Merge branch 'ps-improve-fe-integration-spec-error-log' into 'master'

Improve FE integration spec error logging

See merge request gitlab-org/gitlab!64673
parents 97c0f403 a6a2655a
......@@ -7,6 +7,16 @@ beforeEach(() => {
const server = createMockServer();
server.logging = false;
server.pretender.handledRequest = (verb, path, { status, responseText }) => {
if (status >= 500) {
// eslint-disable-next-line no-console
console.log(`
The mock server returned status ${status} with "${verb} ${path}":
${JSON.stringify({ responseText }, null, 2)}
`);
}
};
global.mockServer = server;
});
import { configure } from '@testing-library/dom';
configure({ asyncUtilTimeout: 10000 });
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;
},
});
......@@ -56,24 +56,26 @@ RSpec.describe Tooling::Danger::ProjectHelper do
'ee/doc/foo' | [:unknown]
'ee/README' | [:unknown]
'app/assets/foo' | [:frontend]
'app/views/foo' | [:frontend]
'public/foo' | [:frontend]
'scripts/frontend/foo' | [:frontend]
'spec/javascripts/foo' | [:frontend]
'spec/frontend/bar' | [:frontend]
'vendor/assets/foo' | [:frontend]
'babel.config.js' | [:frontend]
'jest.config.js' | [:frontend]
'package.json' | [:frontend]
'yarn.lock' | [:frontend]
'config/foo.js' | [:frontend]
'config/deep/foo.js' | [:frontend]
'ee/app/assets/foo' | [:frontend]
'ee/app/views/foo' | [:frontend]
'ee/spec/javascripts/foo' | [:frontend]
'ee/spec/frontend/bar' | [:frontend]
'app/assets/foo' | [:frontend]
'app/views/foo' | [:frontend]
'public/foo' | [:frontend]
'scripts/frontend/foo' | [:frontend]
'spec/javascripts/foo' | [:frontend]
'spec/frontend/bar' | [:frontend]
'spec/frontend_integration/bar' | [:frontend]
'vendor/assets/foo' | [:frontend]
'babel.config.js' | [:frontend]
'jest.config.js' | [:frontend]
'package.json' | [:frontend]
'yarn.lock' | [:frontend]
'config/foo.js' | [:frontend]
'config/deep/foo.js' | [:frontend]
'ee/app/assets/foo' | [:frontend]
'ee/app/views/foo' | [:frontend]
'ee/spec/javascripts/foo' | [:frontend]
'ee/spec/frontend/bar' | [:frontend]
'ee/spec/frontend_integration/bar' | [:frontend]
'.gitlab/ci/frontend.gitlab-ci.yml' | %i[frontend engineering_productivity]
......
......@@ -49,7 +49,7 @@ module Tooling
)\z}x => [:frontend, :product_intelligence],
%r{\A(ee/)?app/(assets|views)/} => :frontend,
%r{\A(ee/)?public/} => :frontend,
%r{\A(ee/)?spec/(javascripts|frontend)/} => :frontend,
%r{\A(ee/)?spec/(javascripts|frontend|frontend_integration)/} => :frontend,
%r{\A(ee/)?vendor/assets/} => :frontend,
%r{\A(ee/)?scripts/frontend/} => :frontend,
%r{(\A|/)(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment