Skip to content

Commit 58bc3f7

Browse files
committed
Configure Vitest for unit and browser tests
1 parent 5eb1153 commit 58bc3f7

File tree

77 files changed

+1613
-269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1613
-269
lines changed

bin/test_package.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,33 @@ if ! command -v jq &> /dev/null; then
2222
fi
2323

2424
runTestSuite() {
25-
echo -e "Running tests for $workspace...\n"
25+
echo -e "🧪 Running tests for $workspace...\n"
2626
pnpm exec vitest --run || { all_tests_passed=false; }
2727
}
2828

2929
processWorkspace() {
3030
local location="$1"
3131

3232
if [ ! -d "$location" ]; then
33-
echo "No directory found at $location"
33+
echo "No directory found at $location"
3434
return
3535
fi
3636

3737
package_json_path="$location/package.json"
3838
if [ ! -f "$package_json_path" ]; then
39-
echo "No package.json found at $package_json_path"
39+
echo "No package.json found at $package_json_path"
4040
return
4141
fi
4242

4343
workspace=$(jq -r '.name' "$package_json_path")
4444
if [ -z "$workspace" ]; then
45-
echo "No name found in package.json at $package_json_path"
45+
echo "No name found in package.json at $package_json_path"
4646
return
4747
fi
4848

49-
echo -e "Processing workspace $workspace at location $location...\n"
49+
echo -e "Processing workspace $workspace at location $location...\n"
5050

51-
echo "Checking '$package_json_path' for peerDependencies and importmap dependencies to have the same version"
51+
echo "⚙️ Checking '$package_json_path' for peerDependencies and importmap dependencies to have the same version"
5252
deps=$(jq -r '.peerDependencies | keys[]' "$package_json_path")
5353
for library in $deps; do
5454
version=$(jq -r ".peerDependencies.\"$library\"" "$package_json_path")
@@ -61,7 +61,7 @@ processWorkspace() {
6161
fi
6262
done
6363

64-
echo "Checking '$package_json_path' for peerDependencies with multiple versions defined"
64+
echo "⚙️ Checking '$package_json_path' for peerDependencies with multiple versions defined"
6565
deps_with_multiple_versions=$(jq -r '.peerDependencies | to_entries[] | select(.value | contains("||")) | .key' "$package_json_path")
6666

6767
if [ -n "$deps_with_multiple_versions" ]; then
@@ -84,7 +84,7 @@ processWorkspace() {
8484
done
8585

8686
echo " -> Reverting version changes from $package_json_path"
87-
git checkout -- "$package_json_path"
87+
git checkout -- "$package_json_path" "$PROJECT_DIR/pnpm-lock.yaml"
8888
else
8989
echo -e " -> No peerDependencies found with multiple versions defined\n"
9090
runTestSuite

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"scripts": {
1010
"build": "pnpm run --filter @symfony/ux-map build && pnpm run -r --aggregate-output build",
11-
"test": "pnpm run -r --aggregate-output test",
11+
"test": "pnpm run -r --workspace-concurrency=1 test",
1212
"check": "biome check",
1313
"ci": "biome ci"
1414
},
@@ -19,10 +19,10 @@
1919
"@types/node": "^22.6.0",
2020
"lightningcss": "^1.28.2",
2121
"pkg-types": "^2.2.0",
22-
"playwright": "^1.47.0",
2322
"tinyglobby": "^0.2.14",
2423
"tsup": "^8.5.0",
25-
"vitest": "^3.2.4"
24+
"vitest": "^3.2.4",
25+
"webdriverio": "^9.19.1"
2626
},
2727
"version": "2.27.0"
2828
}

0 commit comments

Comments
 (0)