to launch a unit test : ng test <project-name> [options]
available options
- --help: shows a help message for this command in the console.
- --code-coverage: inculde code coverage in the report, html report will be found in the coverage directory
- --test-file: specify the name of the test file to be ran
- --watch: watch files for changes and rerun tests related to changed files.
- --watch-all: Watch files for changes and rerun all tests when something changes.
to launch a unit test : ng e2e <project-name-e2e>
available options
- --help: shows a help message for this command in the console.
- --watch: recompile and run tests when files change.
- --headless: whether or not to open the Cypress application to run the tests. If set to 'true', will run in headless mode
dependency graph
command npm run dep-graph show dependencies between the libs and apps of the workspace in the form of a graph
affected
How it works: the nx workspace is actually smart enough to figure out the dependencies between your applications and libraries and it uses that feature to compare your last commit (at least one commit has to happen) with the current code and it launches the affected command on the changed parts.
command npm run affected:[element] -- [Options]
element
- apps: print applications affected by changes documentation link
- build: build applications and publishable libraries affected by changes documentation link
- dep-graph: graph dependencies affected by changes documentation link
- libs: print libraries affected by changes documentation link
- test: run jest unit tests affected by the change documentation link
- e2e: run e2e tests affected by the change documentation link
Note: the affected mechanism is visible if used alongside with git!