js.mk

js-install

Synopsis: make js-install

Hooks: js-pre-install, js-post-install

Variables:

Variable

Description

JS_PACKAGE_MANAGER

<package manager executor> - defaults to yarn

JS_SWITCHES_FOR_INSTALL

<switches for install command>

Install JS project dependencies

js-install-clean

Synopsis: make js-install-clean

Clean JS project dependencies

js-install-reinstall

Synopsis: make js-install-reinstall

Cleanly reinstall JS project dependencies

js-format

Synopsis: make js-format

Hooks: js-pre-format, js-post-format

Variables:

Variable

Description

JS_SRC

<file or directory path to JS code> - default ‘src/’

JS_COMMAND_RUNNER

<command executor> - defaults to npx

JS_ESLINT_CONFIG

<path to eslint config file> - defaults to .eslintrc.js

JS_ESLINT_FILE_EXTENSIONS

<file extensions> - defaults to js,jsx,ts,tsx

JS_VARS_BEFORE_ESLINT_FORMAT

<environment variables to pass to eslint>

JS_SWITCHES_FOR_ESLINT_FORMAT

<switches to pass to eslint>

Reformat project javascript code in the given directories/files using eslint

js-lint

Synopsis: make js-lint

Hooks: js-pre-lint, js-post-lint

Variables:

Variable

Description

JS_SRC

<file or directory path to JS code> - default ‘src/’

JS_BUILD_REPORTS_DIRECTORY

<directory to store build and test results>

JS_COMMAND_RUNNER

<command executor> - defaults to npx

JS_PACKAGE_MANAGER

<package manager to use> - defaults to yarn

JS_ESLINT_FILE_EXTENSIONS

<file extensions> - defaults to js,jsx,ts,tsx

JS_VARS_BEFORE_ESLINT_LINT

<environment variables to pass to eslint>

JS_SWITCHES_FOR_ESLINT_LINT

<switches to pass to eslint>

Lint check javascript code in the given directories/files using eslint

js-audit

Synopsis: make js-audit

Hooks: js-pre-audit, js-post-audit

Variables:

Variable

Description

JS_PACKAGE_MANAGER

<package manager executor> - defaults to yarn

JS_SWITCHES_FOR_AUDIT

<switches for install command>

Check project dependencies for vulnerabilities

js-test

Synopsis: make js-test

Hooks: js-pre-test, js-post-test

Variables:

Variable

Description

JS_SRC

<file or directory path to JS code> - default ‘src/’

JS_BUILD_REPORTS_DIRECTORY

<directory to store build and test results>

JS_COMMAND_RUNNER

<command executor> - defaults to npx

JS_TEST_COMMAND

<command to invoke tests> - defaults to jest

JS_TEST_SWITCHES

<extra switches to pass to test command>

JS_TEST_DEFAULT_SWITCHES

<default switches plus extra to pass to test command>

Run javascript unit tests using jest

js-e2e-test

Synopsis: make js-e2e-test

Hooks: js-pre-e2e-test, js-post-e2e-test

Variables:

Variable

Description

JS_SRC

<file or directory path to JS code> - default ‘src/’

JS_BUILD_REPORTS_DIRECTORY

<directory to store build and test results>

JS_COMMAND_RUNNER

<command executor> - defaults to npx

JS_BUILD_TESTS_DIRECTORY

<directory to store individual e2e test reports>

JS_E2E_TESTS_DIR

<path to location of e2e tests> - defaults to ‘tests/cypress/’

JS_E2E_VARS_BEFORE_TEST

<vars before e2e test command>

JS_E2E_TEST_COMMAND

<command to invoke e2e tests> - defaults to cypress

JS_E2E_COVERAGE_ENABLED

<boolean flag for including coverage report> - defaults to true

JS_E2E_TEST_SWITCHES

<extra switches to pass to test command>

JS_E2E_TEST_DEFAULT_SWITCHES

<default switches plus extra to pass to test command>

Run javascript e2e tests using cypress