Move some of the slowest tests from jest to vitest (#34277)
* Remove doubled-up I18n Provider. ModalManager already provides this. * Reconfigure svgr into a vite-friendly `?react` resource query * Move InviteDialog test to vitest * Move RoomHeader tests to Vitest * Share serializer between Jest & Vitest * Attempt to stabilise InviteDialog test * Fix async leaks * Iterate based on copilot review * Fix InviteDialog throttle * Iterate * Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Fix lockfile * Iterate --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI
parent
5b0fd416fd
commit
2430e0ab8b
+44
-52
@@ -506,62 +506,54 @@ export default (env: string, argv: Record<string, any>): webpack.Configuration =
|
||||
{
|
||||
test: /\.svg$/,
|
||||
issuer: /\.(js|ts|jsx|tsx|html)$/,
|
||||
resourceQuery: { not: [/raw/] },
|
||||
use: [
|
||||
{
|
||||
loader: "@svgr/webpack",
|
||||
options: {
|
||||
namedExport: "Icon",
|
||||
svgProps: {
|
||||
"role": "presentation",
|
||||
"aria-hidden": true,
|
||||
},
|
||||
// props set on the svg will override defaults
|
||||
expandProps: "end",
|
||||
svgoConfig: {
|
||||
plugins: [
|
||||
{
|
||||
name: "preset-default",
|
||||
params: {
|
||||
overrides: {
|
||||
removeViewBox: false,
|
||||
},
|
||||
},
|
||||
resourceQuery: /react/,
|
||||
loader: "@svgr/webpack",
|
||||
options: {
|
||||
svgProps: {
|
||||
"role": "presentation",
|
||||
"aria-hidden": true,
|
||||
},
|
||||
// props set on the svg will override defaults
|
||||
expandProps: "end",
|
||||
svgoConfig: {
|
||||
plugins: [
|
||||
{
|
||||
name: "preset-default",
|
||||
params: {
|
||||
overrides: {
|
||||
removeViewBox: false,
|
||||
},
|
||||
// generates a viewbox if missing
|
||||
{ name: "removeDimensions" },
|
||||
// https://github.com/facebook/docusaurus/issues/8297
|
||||
{ name: "prefixIds" },
|
||||
],
|
||||
},
|
||||
},
|
||||
/**
|
||||
* Forwards the React ref to the root SVG element
|
||||
* Useful when using things like `asChild` in
|
||||
* radix-ui
|
||||
*/
|
||||
ref: true,
|
||||
esModule: false,
|
||||
name: "[name].[hash:7].[ext]",
|
||||
outputPath: getAssetOutputPath,
|
||||
publicPath: function (url: string, resourcePath: string) {
|
||||
const outputPath = getAssetOutputPath(url, resourcePath);
|
||||
return toPublicPath(outputPath);
|
||||
},
|
||||
},
|
||||
// generates a viewbox if missing
|
||||
{ name: "removeDimensions" },
|
||||
// https://github.com/facebook/docusaurus/issues/8297
|
||||
{ name: "prefixIds" },
|
||||
],
|
||||
},
|
||||
{
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
esModule: false,
|
||||
name: "[name].[hash:7].[ext]",
|
||||
outputPath: getAssetOutputPath,
|
||||
publicPath: function (url: string, resourcePath: string) {
|
||||
const outputPath = getAssetOutputPath(url, resourcePath);
|
||||
return toPublicPath(outputPath);
|
||||
},
|
||||
},
|
||||
/**
|
||||
* Forwards the React ref to the root SVG element
|
||||
* Useful when using things like `asChild` in
|
||||
* radix-ui
|
||||
*/
|
||||
ref: true,
|
||||
esModule: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
issuer: /\.(js|ts|jsx|tsx|html)$/,
|
||||
resourceQuery: { not: [/raw/, /react/] },
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
esModule: false,
|
||||
name: "[name].[hash:7].[ext]",
|
||||
outputPath: getAssetOutputPath,
|
||||
publicPath: function (url: string, resourcePath: string) {
|
||||
const outputPath = getAssetOutputPath(url, resourcePath);
|
||||
return toPublicPath(outputPath);
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.svg$/,
|
||||
|
||||
Reference in New Issue
Block a user