githubEdit

Testing your source code via the CLI

Snyk Code enables you to test the source code of your repositories via the Snyk CLI.

Notes:

When testing your repository code via the CLI, you can:

Testing a repository from its root folder

To test the current repository folder:

  • In the terminal, enter:

snyk code test

Note: No additional parameters are required for running Snyk Code to test a repository from its root folder.

Snyk Code tests the current folder, and displays the test resultsarrow-up-right in the terminal.

For example:

To test the snyk-goof repository from its root folder, we first changed the directory to the root folder of the repository. Then, we enter:

Snyk Code tests the snyk-goof repository, and displays the vulnerability issue that were discovered in the terminal:

Testing a repository from a different location

To test a repository from another folder:

  • In the terminal, enter:

Where:

  • path/to/folder – the full path of the repository you want to test via Snyk Code.

For example:

To test the snyk-goof repository from another directory, we enter:

Last updated

Was this helpful?