-
Notifications
You must be signed in to change notification settings - Fork 52
Development Scripts
Andrei Anischevici edited this page Nov 18, 2021
·
4 revisions
Several npm scripts have been provided for assisting in development. Each script can be run by navigating to the cloned repository directory in a terminal and executing npm run scriptname where scriptname is the name of the script you would like to run. The most useful scripts are as follows:
-
devSpins up a sandbox website where you can manually test the library as though you were a consumer using the library. The sandbox files can be found in thesandboxdirectory and can be modified to suit your needs. -
testRuns unit and functional tests against source files. Tests can be found in thetestdirectory. -
test:unitRuns unit tests against source files. Unit tests can be found in thetest/unitdirectory. This will be automatically run when you make a Git commit. -
test:unit:watchSame astest:unit, but will re-run the tests as you change source files or test files. -
test:functionalRuns functional tests against source files. Functional tests can be found in thetest/functionaldirectory. -
test:functional:watchSame astest:functional, but will re-run the tests as you change source files or test files (after changing source files you'll need to hit Ctrl+R to re-run tests). Functional tests can be found in thetest/functionaldirectory. -
test:functional:debugStarts a Node.js debug server, allowing functional test debugging via IDE/browser debuggers. Supply a test name regex to debug a single test, e.g.npm run test:functional:debug -- -T "Test C28758.*" -
lintAnalyzes code for potential errors. This will be automatically run when you make a Git commit. -
formatFormats code to match agreed-upon style guidelines. This will be automatically run when you make a Git commit.
When you attempt to commit code changes, several of the above tasks will be run automatically to help ensure that your changes pass tests and are consistent with agreed-upon standards.