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

@@ -56,7 +56,7 @@ The background color of the `.mood-board-item` element should be set to the valu
```js
async () => {
const container = await __prepTestComponent(window.index.MoodBoardItem, { color: "red" });
const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { color: "red" });
const moodBoardItem = container.querySelector(".mood-board-item");
assert.equal(moodBoardItem.style.backgroundColor, "red");
}
@@ -66,7 +66,7 @@ Your `MoodBoardItem` component should render an `img` element with a class of `m
```js
async () => {
const container = await __prepTestComponent(window.index.MoodBoardItem, { image: "https://cdn.freecodecamp.org/curriculum/labs/pathway.jpg" });
const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { image: "https://cdn.freecodecamp.org/curriculum/labs/pathway.jpg" });
const img = container.querySelector(".mood-board-image");
assert.exists(img);
assert.equal(img.tagName, "IMG");
@@ -78,7 +78,7 @@ Your `MoodBoardItem` component should render an `h3` element with a class of `mo
```js
async () => {
const container = await __prepTestComponent(window.index.MoodBoardItem, { description: "Carribean" });
const container = await __helpers.prepTestComponent(window.index.MoodBoardItem, { description: "Carribean" });
const text = container.querySelector(".mood-board-text");
assert.exists(text);
assert.equal(text.tagName, "H3");

View File

@@ -15,7 +15,7 @@ Your `Card` component should not render an empty string.
```js
async () => {
const testElem = await __prepTestComponent(window.index.Card);
const testElem = await __helpers.prepTestComponent(window.index.Card);
assert.notEqual(testElem.innerHTML, '');
}
```
@@ -24,7 +24,7 @@ You should create a `div` element with the `className` `card` at the top level o
```js
async () => {
const testElem = await __prepTestComponent(window.index.Card);
const testElem = await __helpers.prepTestComponent(window.index.Card);
const div = testElem.firstElementChild;
assert.include([...div?.classList], 'card');
}

View File

@@ -17,7 +17,7 @@ You should create an `h2` element inside your `div` element.
```js
async () => {
const testElem = await __prepTestComponent(window.index.Card);
const testElem = await __helpers.prepTestComponent(window.index.Card);
const h2Elem = testElem.querySelector('div > h2');
assert.exists(h2Elem);
}
@@ -27,7 +27,7 @@ Your `h2` element should have `{name}` as its text content.
```js
async () => {
const testElem = await __prepTestComponent(window.index.Card, { name: 'nameVal' });
const testElem = await __helpers.prepTestComponent(window.index.Card, { name: 'nameVal' });
const h2Elem = testElem.querySelector('div > h2');
// trimming because we don't need to be picky about whitespace
assert.equal(h2Elem.textContent.trim(), 'nameVal');
@@ -38,7 +38,7 @@ You should create a `p` tag with the `className` of `card-title` inside your `di
```js
async () => {
const testElem = await __prepTestComponent(window.index.Card);
const testElem = await __helpers.prepTestComponent(window.index.Card);
const pElem = testElem.querySelector('div > p.card-title');
assert.exists(pElem);
}
@@ -48,7 +48,7 @@ Your `p` element with `className` of `card-title` should have `{title}` as its t
```js
async () => {
const testElem = await __prepTestComponent(window.index.Card, { title: 'titleVal' });
const testElem = await __helpers.prepTestComponent(window.index.Card, { title: 'titleVal' });
const pElem = testElem.querySelector('div > p.card-title');
// trimming because we don't need to be picky about whitespace
assert.equal(pElem.textContent.trim(), 'titleVal');
@@ -59,7 +59,7 @@ You should create another `p` element with `{bio}` as its text.
```js
async () => {
const testElem = await __prepTestComponent(window.index.Card, {title: 'titleVal', bio: 'bioVal' });
const testElem = await __helpers.prepTestComponent(window.index.Card, {title: 'titleVal', bio: 'bioVal' });
// trimming because we don't need to be picky about whitespace
const texts = [...testElem.querySelectorAll('div > p')].map((p) => p.textContent.trim());
const bioText = texts.find((text) => text.includes('bioVal'));

View File

@@ -25,7 +25,7 @@ Your `App` component should return an empty string.
// This isn't a perfect test, since various return values are converted into
// empty strings, but it has to be a valid React component.
async() => {
const testElem = await __prepTestComponent(window.index.App);
const testElem = await __helpers.prepTestComponent(window.index.App);
assert.equal(testElem.textContent, '');
}
```

View File

@@ -15,7 +15,7 @@ Your `App` component should not render an empty string.
```js
async () => {
const testElem = await __prepTestComponent(window.index.App);
const testElem = await __helpers.prepTestComponent(window.index.App);
assert.notEqual(testElem.innerHTML, '');
}
```
@@ -24,7 +24,7 @@ Your `App` component should return a single `div` element.
```js
async () => {
const testElem = await __prepTestComponent(window.index.App);
const testElem = await __helpers.prepTestComponent(window.index.App);
assert.equal(testElem.firstElementChild?.tagName, 'DIV');
assert.lengthOf(testElem.children, 1);
}
@@ -34,7 +34,7 @@ Your `div` should have a `className` property of `flex-container`.
```js
async () => {
const testElem = await __prepTestComponent(window.index.App);
const testElem = await __helpers.prepTestComponent(window.index.App);
assert.include([...testElem.firstElementChild.classList], 'flex-container');
}
```

View File

@@ -15,7 +15,7 @@ You should use the `Card` component in your `App` component.
```js
async () => {
const testElem = await __prepTestComponent(window.index.App);
const testElem = await __helpers.prepTestComponent(window.index.App);
const card = testElem.querySelector('.card');
assert.exists(card);
}
@@ -25,7 +25,7 @@ You should pass the `name` prop with value `"Mark"` to your `Card` component.
```js
async () => {
const testElem = await __prepTestComponent(window.index.App);
const testElem = await __helpers.prepTestComponent(window.index.App);
const card = testElem.querySelector('.card');
assert.equal(card.querySelector('h2').textContent, 'Mark');
}
@@ -35,7 +35,7 @@ You should pass the `title` prop with value `"Frontend developer"` to your `Card
```js
async () => {
const testElem = await __prepTestComponent(window.index.App);
const testElem = await __helpers.prepTestComponent(window.index.App);
const card = testElem.querySelector('.card');
assert.equal(card.querySelector('.card-title').textContent, 'Frontend developer');
}
@@ -45,7 +45,7 @@ You should pass the `bio` prop with value `"I like to work with different fronte
```js
async () => {
const testElem = await __prepTestComponent(window.index.App);
const testElem = await __helpers.prepTestComponent(window.index.App);
const card = testElem.querySelector('.card');
assert.equal(card.querySelector('p:last-child').textContent, 'I like to work with different frontend technologies and play video games.');
}

124
pnpm-lock.yaml generated
View File

@@ -827,7 +827,7 @@ importers:
version: 10.9.2(@types/node@20.12.8)(typescript@5.2.2)
webpack:
specifier: 5.90.3
version: 5.90.3(webpack-cli@4.10.0)
version: 5.90.3
curriculum:
devDependencies:
@@ -1115,14 +1115,14 @@ importers:
specifier: 7.23.3
version: 7.23.3(@babel/core@7.23.7)
'@freecodecamp/curriculum-helpers':
specifier: 3.8.0
version: 3.8.0
specifier: 3.9.0
version: 3.9.0
'@types/chai':
specifier: 4.3.12
version: 4.3.12
'@types/copy-webpack-plugin':
specifier: ^8.0.1
version: 8.0.1(webpack-cli@4.10.0)
version: 8.0.1(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3))
'@types/enzyme':
specifier: 3.10.16
version: 3.10.16
@@ -1140,13 +1140,13 @@ importers:
version: 1.6.0(typescript@5.4.5)
babel-loader:
specifier: 8.3.0
version: 8.3.0(@babel/core@7.23.7)(webpack@5.90.3)
version: 8.3.0(@babel/core@7.23.7)(webpack@5.90.3(webpack-cli@4.10.0))
chai:
specifier: 4.4.1
version: 4.4.1
copy-webpack-plugin:
specifier: 9.1.0
version: 9.1.0(webpack@5.90.3)
version: 9.1.0(webpack@5.90.3(webpack-cli@4.10.0))
enzyme:
specifier: 3.11.0
version: 3.11.0
@@ -3077,8 +3077,8 @@ packages:
'@fortawesome/fontawesome-svg-core': ~1 || ~6
react: '>=16.3'
'@freecodecamp/curriculum-helpers@3.8.0':
resolution: {integrity: sha512-cEjGBBBbvCmpnI4fGVYfqtwydf/TvQTbiYWgYaY+7yHsI1CeiA+/hMEW8smXz2VSkjoHnZbqRC08GIkBeCtl1A==}
'@freecodecamp/curriculum-helpers@3.9.0':
resolution: {integrity: sha512-D7k5H0Fi1PQldVyF/yF+ZW0zyAflvkgdOSaiJeaIUkydjkiycz0w01D0CQbPQIfZdTTK0uRQJ08IKeESZ2OnWw==}
engines: {npm: '>= 4.0.0'}
'@freecodecamp/loop-protect@3.0.0':
@@ -17085,7 +17085,7 @@ snapshots:
prop-types: 15.8.1
react: 16.14.0
'@freecodecamp/curriculum-helpers@3.8.0':
'@freecodecamp/curriculum-helpers@3.9.0':
dependencies:
browserify: 17.0.0
@@ -17676,7 +17676,7 @@ snapshots:
react-refresh: 0.9.0
schema-utils: 2.7.1
source-map: 0.7.4
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
'@polka/url@1.0.0-next.23': {}
@@ -18416,7 +18416,7 @@ snapshots:
'@types/cookiejar@2.1.2': {}
'@types/copy-webpack-plugin@8.0.1(webpack-cli@4.10.0)':
'@types/copy-webpack-plugin@8.0.1(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3))':
dependencies:
'@types/node': 20.8.0
tapable: 2.2.1
@@ -19165,17 +19165,17 @@ snapshots:
'@webassemblyjs/ast': 1.11.6
'@xtuc/long': 4.2.2
'@webpack-cli/configtest@1.2.0(webpack-cli@4.10.0)(webpack@5.90.3)':
'@webpack-cli/configtest@1.2.0(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3))(webpack@5.90.3(webpack-cli@4.10.0))':
dependencies:
webpack: 5.90.3(webpack-cli@4.10.0)
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3)
'@webpack-cli/info@1.5.0(webpack-cli@4.10.0)':
'@webpack-cli/info@1.5.0(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3))':
dependencies:
envinfo: 7.10.0
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3)
'@webpack-cli/serve@1.7.0(webpack-cli@4.10.0)':
'@webpack-cli/serve@1.7.0(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3))':
dependencies:
webpack-cli: 4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3)
@@ -19659,9 +19659,9 @@ snapshots:
loader-utils: 2.0.4
make-dir: 3.1.0
schema-utils: 2.7.1
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
babel-loader@8.3.0(@babel/core@7.23.7)(webpack@5.90.3):
babel-loader@8.3.0(@babel/core@7.23.7)(webpack@5.90.3(webpack-cli@4.10.0)):
dependencies:
'@babel/core': 7.23.7
find-cache-dir: 3.3.2
@@ -20788,7 +20788,7 @@ snapshots:
copy-descriptor@0.1.1: {}
copy-webpack-plugin@9.1.0(webpack@5.90.3):
copy-webpack-plugin@9.1.0(webpack@5.90.3(webpack-cli@4.10.0)):
dependencies:
fast-glob: 3.3.1
glob-parent: 6.0.2
@@ -20980,7 +20980,7 @@ snapshots:
postcss-value-parser: 4.2.0
schema-utils: 3.3.0
semver: 7.6.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
css-mediaquery@0.1.2: {}
@@ -20993,7 +20993,7 @@ snapshots:
schema-utils: 3.3.0
serialize-javascript: 5.0.1
source-map: 0.6.1
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
css-select@4.3.0:
dependencies:
@@ -21928,7 +21928,7 @@ snapshots:
debug: 4.3.4(supports-color@8.1.1)
enhanced-resolve: 5.15.0
eslint: 8.57.0
eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.5)(eslint@8.57.0)
eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.5(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0)
eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.5.5)(eslint@8.57.0)
get-tsconfig: 4.7.2
globby: 13.2.2
@@ -21952,7 +21952,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
eslint-module-utils@2.8.0(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.5)(eslint@8.57.0):
eslint-module-utils@2.8.0(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.5(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0):
dependencies:
debug: 3.2.7(supports-color@5.5.0)
optionalDependencies:
@@ -22025,7 +22025,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.5)(eslint@8.57.0)
eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.5(@typescript-eslint/parser@7.1.1(eslint@8.57.0)(typescript@5.4.5))(eslint-plugin-import@2.29.1)(eslint@8.57.0))(eslint@8.57.0)
hasown: 2.0.0
is-core-module: 2.13.1
is-glob: 4.0.3
@@ -22206,7 +22206,7 @@ snapshots:
micromatch: 4.0.8
normalize-path: 3.0.0
schema-utils: 3.3.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
eslint@7.32.0:
dependencies:
@@ -22697,7 +22697,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
file-type@16.5.4:
dependencies:
@@ -22828,7 +22828,7 @@ snapshots:
semver: 5.7.2
tapable: 1.1.3
typescript: 5.2.2
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
worker-rpc: 0.1.1
optionalDependencies:
eslint: 7.32.0
@@ -23403,7 +23403,7 @@ snapshots:
url-loader: 4.1.1(file-loader@6.2.0(webpack@5.90.3))(webpack@5.90.3)
uuid: 3.4.0
v8-compile-cache: 2.4.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
webpack-dev-middleware: 4.3.0(webpack@5.90.3)
webpack-merge: 5.9.0
webpack-stats-plugin: 1.1.3
@@ -26515,7 +26515,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
webpack-sources: 1.4.3
minimalistic-assert@1.0.1: {}
@@ -26619,7 +26619,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
monaco-editor: 0.28.1
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
monaco-editor@0.28.1: {}
@@ -26921,7 +26921,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
nwsapi@2.2.7: {}
@@ -27502,7 +27502,7 @@ snapshots:
postcss: 8.4.35
schema-utils: 3.3.0
semver: 7.6.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
postcss-loader@5.3.0(postcss@8.4.35)(webpack@5.90.3):
dependencies:
@@ -27510,7 +27510,7 @@ snapshots:
klona: 2.0.6
postcss: 8.4.35
semver: 7.6.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
postcss-merge-longhand@5.1.7(postcss@8.4.35):
dependencies:
@@ -27985,7 +27985,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
rc@1.2.8:
dependencies:
@@ -28020,7 +28020,7 @@ snapshots:
shell-quote: 1.7.2
strip-ansi: 6.0.0
text-table: 0.2.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
optionalDependencies:
typescript: 5.2.2
transitivePeerDependencies:
@@ -29530,7 +29530,7 @@ snapshots:
dependencies:
loader-utils: 2.0.4
schema-utils: 3.3.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
style-to-object@0.3.0:
dependencies:
@@ -29730,7 +29730,7 @@ snapshots:
term-size@2.2.1: {}
terser-webpack-plugin@5.3.10(webpack@5.90.3):
terser-webpack-plugin@5.3.10(webpack@5.90.3(webpack-cli@4.10.0)):
dependencies:
'@jridgewell/trace-mapping': 0.3.25
jest-worker: 27.5.1
@@ -29739,6 +29739,15 @@ snapshots:
terser: 5.28.1
webpack: 5.90.3(webpack-cli@4.10.0)
terser-webpack-plugin@5.3.10(webpack@5.90.3):
dependencies:
'@jridgewell/trace-mapping': 0.3.25
jest-worker: 27.5.1
schema-utils: 3.3.0
serialize-javascript: 6.0.1
terser: 5.28.1
webpack: 5.90.3
terser-webpack-plugin@5.3.9(webpack@5.90.3):
dependencies:
'@jridgewell/trace-mapping': 0.3.22
@@ -29746,7 +29755,7 @@ snapshots:
schema-utils: 3.3.0
serialize-javascript: 6.0.1
terser: 5.20.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
terser@5.20.0:
dependencies:
@@ -30394,7 +30403,7 @@ snapshots:
loader-utils: 2.0.4
mime-types: 2.1.35
schema-utils: 3.3.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
optionalDependencies:
file-loader: 6.2.0(webpack@5.90.3)
@@ -30609,9 +30618,9 @@ snapshots:
webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3):
dependencies:
'@discoveryjs/json-ext': 0.5.7
'@webpack-cli/configtest': 1.2.0(webpack-cli@4.10.0)(webpack@5.90.3)
'@webpack-cli/info': 1.5.0(webpack-cli@4.10.0)
'@webpack-cli/serve': 1.7.0(webpack-cli@4.10.0)
'@webpack-cli/configtest': 1.2.0(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3))(webpack@5.90.3(webpack-cli@4.10.0))
'@webpack-cli/info': 1.5.0(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3))
'@webpack-cli/serve': 1.7.0(webpack-cli@4.10.0(webpack-bundle-analyzer@4.10.1)(webpack@5.90.3))
colorette: 2.0.20
commander: 7.2.0
cross-spawn: 7.0.3
@@ -30632,7 +30641,7 @@ snapshots:
mime-types: 2.1.35
range-parser: 1.2.1
schema-utils: 3.3.0
webpack: 5.90.3(webpack-cli@4.10.0)
webpack: 5.90.3
webpack-merge@5.9.0:
dependencies:
@@ -30654,6 +30663,37 @@ snapshots:
transitivePeerDependencies:
- supports-color
webpack@5.90.3:
dependencies:
'@types/eslint-scope': 3.7.5
'@types/estree': 1.0.5
'@webassemblyjs/ast': 1.11.6
'@webassemblyjs/wasm-edit': 1.11.6
'@webassemblyjs/wasm-parser': 1.11.6
acorn: 8.11.3
acorn-import-assertions: 1.9.0(acorn@8.11.3)
browserslist: 4.23.0
chrome-trace-event: 1.0.3
enhanced-resolve: 5.15.0
es-module-lexer: 1.3.1
eslint-scope: 5.1.1
events: 3.3.0
glob-to-regexp: 0.4.1
graceful-fs: 4.2.11
json-parse-even-better-errors: 2.3.1
loader-runner: 4.3.0
mime-types: 2.1.35
neo-async: 2.6.2
schema-utils: 3.3.0
tapable: 2.2.1
terser-webpack-plugin: 5.3.10(webpack@5.90.3)
watchpack: 2.4.0
webpack-sources: 3.2.3
transitivePeerDependencies:
- '@swc/core'
- esbuild
- uglify-js
webpack@5.90.3(webpack-cli@4.10.0):
dependencies:
'@types/eslint-scope': 3.7.5
@@ -30677,7 +30717,7 @@ snapshots:
neo-async: 2.6.2
schema-utils: 3.3.0
tapable: 2.2.1
terser-webpack-plugin: 5.3.10(webpack@5.90.3)
terser-webpack-plugin: 5.3.10(webpack@5.90.3(webpack-cli@4.10.0))
watchpack: 2.4.0
webpack-sources: 3.2.3
optionalDependencies:

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",