Skip to content

Commit 0eeccf1

Browse files
authored
chore: fix N* tests (#33480)
1 parent 084c766 commit 0eeccf1

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as React from 'react';
2+
import * as ReactDOM from 'react-dom';
3+
import App from './App';
4+
5+
const root = document.getElementById('root') as HTMLElement;
6+
7+
ReactDOM.render(<App />, root);

packages/fluentui/projects-test/src/createReactApp.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ export async function createReactApp() {
3737
await addResolutionPathsForProjectPackages(testAppPathRoot);
3838

3939
await shEcho(`yarn add ${packedPackages['@fluentui/react-northstar']}`, testAppPathRoot);
40+
41+
// Enforce React 17
42+
const dependencies = ['@types/react@17', '@types/react-dom@17', 'react@17', 'react-dom@17'].join(' ');
43+
await shEcho(`yarn add ${dependencies}`, tempPaths.testApp);
44+
4045
logger(`✔️ Fluent UI packages were added to dependencies`);
4146

4247
logger("STEP 3. Reference Fluent UI components in test project's App.tsx");

packages/fluentui/react-northstar/jest.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const config = commonConfig({
1010
// Legacy aliases, they should not be used in new tests
1111
...getAliases(),
1212
},
13+
// Keeps Jest from using too much memory as GC gets invokes more often, makes tests slower
14+
// https://stackoverflow.com/a/75857711
15+
workerIdleMemoryLimit: '1024MB',
1316
});
1417
config.setupFilesAfterEnv = [...config.setupFilesAfterEnv, './jest-setup.js'];
1518

0 commit comments

Comments
 (0)