The following npm scripts are the main entrypoints for building and testing the Cisco Webex JS SDK.
Build all packages.
npm run build
Build a single package.
npm run build:package @webex/webex-core
Detect dependencies for each package and insert into the appropriate package.json
.
npm run deps:generate
Lint all JavaScript files.
npm run lint:js
Options may be specified as switches or via environment variables.
Test all packages
npm test
See all options
npm test -- --help
Test a single package
npm test -- --packages @webex/webex-core
Test a single package, but only in a browser
npm test -- --packages @webex/webex-core --browser
Test a single package, but only in a specific browser
BROWSER=chrome npm test -- --packages @webex/webex-core --browser
Test a single package and generate coverage and xunit reports
npm test -- --packages @webex/webex-core --coverage --xunit
Test a single package using snapshots rather than live network requests. The test must be run in Node.
npm test -- --packages @webex/webex-core --node --snapshots
Keeps the browser open in debug mode so that you can set break points and reload the page with code updates
npm test -- --packages @webex/webex-core --browser --karma-debug
make sure Java JDK is installed on your machine to run test locally
npm run samples:test
The SDK uses SauceLabs to run its tests. Sign in to retrieve your USERNAME and ACCESS KEY from User Settings and add them to your .env
file:
SAUCE_USERNAME
SAUCE_ACCESS_KEY
Start the SauceLabs tunnel, run tests using SauceLabs browsers, and stop the SauceLabs tunnel
# Run all tests on SauceLabs with default configuration
SAUCE=true npm run test
# Run the samples automation tests on SauceLabs
SAUCE=true npm run samples:test
# Run `plugin-teams` test suite on SauceLabs only only Edge and IE 11
SAUCE=true npm run test -- --packages @webex/plugin-teams --os Windows --browsers Edge IE
# Run all tests on SauceLabs only with Chrome on Mac and Windows
SAUCE=true npm run test -- --browsers Chrome
Points all of the package.json
s' main entry to their "src" folder. This is useful when testing because it doesn't require you to build a "dist" folder before every run of the test.
npm run distsrc
Used to undo the changes made with distsrc
.
npm run srcdist