Skip to content

Commit

Permalink
Remove lazy require.context
Browse files Browse the repository at this point in the history
  • Loading branch information
Janpot committed Jan 7, 2025
1 parent 0221d17 commit 523b9e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/regressions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ window.muiFixture = {
};

// Get all the fixtures specifically written for preventing visual regressions.
const importRegressionFixtures = require.context('./fixtures', true, /\.(js|ts|tsx)$/, 'lazy');
const importRegressionFixtures = require.context('./fixtures', true, /\.(js|ts|tsx)$/);
const regressionFixtures = [];
importRegressionFixtures.keys().forEach((path) => {
const [suite, name] = path
Expand All @@ -33,7 +33,7 @@ importRegressionFixtures.keys().forEach((path) => {
path,
suite: `regression-${suite}`,
name,
Component: React.lazy(() => importRegressionFixtures(path)),
Component: importRegressionFixtures(path).default,
});
}
}, []);
Expand Down Expand Up @@ -269,7 +269,7 @@ function excludeDemoFixture(suite, name) {
}

// Also use some of the demos to avoid code duplication.
const importDemos = require.context('docs/data', true, /(?<!pagesApi)\.js$/, 'lazy');
const importDemos = require.context('docs/data', true, /(?<!pagesApi)\.js$/);
const demoFixtures = [];
importDemos.keys().forEach((path) => {
const [name, ...suiteArray] = path.replace('./', '').replace('.js', '').split('/').reverse();
Expand All @@ -285,7 +285,7 @@ importDemos.keys().forEach((path) => {
path,
suite,
name,
Component: React.lazy(() => importDemos(path)),
Component: importDemos(path),
});
}
}, []);
Expand Down

0 comments on commit 523b9e3

Please sign in to comment.