chore: update curriculum-helpers to version 3.9.0 (#58525)

This commit is contained in:
Sem Bauke
2025-01-31 15:48:16 +01:00
committed by GitHub
parent 9fb74f3545
commit e60c3f8cee
9 changed files with 101 additions and 78 deletions

View File

@@ -58,23 +58,6 @@ async function initTestFrame(e: InitTestFrameArg = { code: {} }) {
return o;
};
const __prepTestComponent = async (
component: React.ComponentType | React.FunctionComponent | string,
props: Record<string, unknown>
) => {
const testDiv = document.createElement('div');
const createdElement = window.React.createElement(component, props);
// @ts-expect-error the React version is determined at runtime so we can't define the types here
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/require-await
await window.React?.act(async () => {
// @ts-expect-error Same for ReactDOM as for React
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
window.ReactDOM?.createRoot(testDiv).render(createdElement);
});
return testDiv;
};
const { default: chai } = await import(/* webpackChunkName: "chai" */ 'chai');
const assert = chai.assert;
const __helpers = helpers;

View File

@@ -29,7 +29,7 @@
"@babel/plugin-transform-runtime": "7.23.7",
"@babel/preset-env": "7.23.7",
"@babel/preset-typescript": "7.23.3",
"@freecodecamp/curriculum-helpers": "3.8.0",
"@freecodecamp/curriculum-helpers": "3.9.0",
"@types/chai": "4.3.12",
"@types/copy-webpack-plugin": "^8.0.1",
"@types/enzyme": "3.10.16",