Skip to content

Instantly share code, notes, and snippets.

@jusopi
Created April 18, 2024 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jusopi/2505e035d089cf4c193722ff0ead4181 to your computer and use it in GitHub Desktop.
Save jusopi/2505e035d089cf4c193722ff0ead4181 to your computer and use it in GitHub Desktop.
NX Monorepo quick test

NX Quick Test

Useful little script that shortcuts the nxtest cmd line.

use

nxtest <target-module> [options]

Default options

  • --skip-nx-cache
  • --code-coverage
#!/bin/sh
# Check if target-module argument was provided
if [ -z "$1" ]; then
echo "Usage: nxtest <target-module> [options]"
exit 1
fi
# Extract target-module argument
target_module="$1"
shift
# Run nx test command with provided target-module, options, and additional arguments
nx test "$target_module" --skip-nx-cache --code-coverage "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment