Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/technologies/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Container image should be set as "HTML/CSS" for React labs as well. The followin

- `static-server` npm package installed globally: [static-server](https://www.npmjs.com/package/static-server)
- Puppeteer installation with Chrome for E2E testing (more on this in Evaluation tab)
- Node.js v14, Yarn, NPM, Bun.js
- Node.js v14, yarn, NPM, Bun.js

The following NPM packages (non-exhaustive list) are globally installed:

Expand Down Expand Up @@ -148,7 +148,7 @@ set -e 1

# Install vitest and testing util
cd /home/damner/code
yarn add vitest@0.32.2 jsdom@22.1.0 @testing-library/jest-dom@5.16.5 @testing-library/react@14.0.0 --dev
bun add vitest@0.32.2 jsdom@22.1.0 @testing-library/jest-dom@5.16.5 @testing-library/react@14.0.0 --dev
mkdir -p /home/damner/code/.labtests

# Move test file
Expand Down Expand Up @@ -192,11 +192,11 @@ cat > /home/damner/code/.labtests/package.json << EOF
EOF

# run test
(yarn vitest run --config=/home/damner/code/.labtests/config.js --threads=false --reporter=json --outputFile=/home/damner/code/.labtests/payload.json || true) | tee /home/damner/code/.labtests/evaluationscript.log
(bun vitest run --config=/home/damner/code/.labtests/config.js --threads=false --reporter=json --outputFile=/home/damner/code/.labtests/payload.json || true) | tee /home/damner/code/.labtests/evaluationscript.log

# Write results to UNIT_TEST_OUTPUT_FILE to communicate to frontend
cd /home/damner/code/.labtests
node process.js
bun process.js
```

You might need to have a little understanding of bash scripting. Let us understand how the evaluation bash script is working:
Expand All @@ -213,7 +213,7 @@ You might need to have a little understanding of bash scripting. Let us understa

![](/images/html-css/playground-tests-2.png)

- Then we run the actual test using `yarn vitest run` command, specifying the output as JSON (read by `process.js`) and in a single thread (as we want ordered results).
- Then we run the actual test using `bun vitest run` command, specifying the output as JSON (read by `process.js`) and in a single thread (as we want ordered results).

- Finally we run the `process.js` file that writes the correct JSON boolean array on `$UNIT_TEST_OUTPUT_FILE` which is then read by the playground UI and marks the lab challenges as pass or fail.

Expand Down
Loading