Skip to content

Commit

Permalink
adding script to run unit tests across multiple projects
Browse files Browse the repository at this point in the history
  • Loading branch information
sagely1 committed Oct 7, 2024
1 parent ec87d3a commit b4958c0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tools/run-unit-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Check if a prefix argument was provided
if [ -z "$1" ]; then
echo "Please provide a project prefix (e.g., agora-)."
exit 1
fi

# Prefix provided by the user
PREFIX=$1

# Find all projects that start with the provided prefix
PROJECTS=$(nx show projects | grep "^$PREFIX" | tr '\n' ',' | sed 's/,$//')

# Check if any projects were found
if [ -z "$PROJECTS" ]; then
echo "No projects found with the prefix '$PREFIX'."
exit 1
fi

# Run the tests for the filtered projects
nx run-many --target=test --projects=$PROJECTS

0 comments on commit b4958c0

Please sign in to comment.