For testing, we’ll want to run a separate environment for it.
nx test [project name] --runInBand
In our git pre-push hooks, we have separate commands for running unit & integration test. The command above runs both.
-runInBand
is only required for integration spec, at it makes sure we run tests sequentially so there are no race conditions for database accessSometimes the caching system breaks down & doesn’t run tests on a modified spec, we could add --skip-nx-cache
for that.
You’ll want to add the --verbose
flag to enable console logging for spec files.