Skip to content

Latest commit

 

History

History
122 lines (81 loc) · 2.62 KB

SCRIPTS.md

File metadata and controls

122 lines (81 loc) · 2.62 KB

Scripts

The following npm scripts are the main entrypoints for building and testing the Cisco Webex JS SDK.

build

Build all packages.

npm run build

deps:generate

Detect dependencies for each package and insert into the appropriate package.json.

npm run deps:generate

lint:js

Lint all JavaScript files.

npm run lint:js

test

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

Run the samples automation tests locally

make sure Java JDK is installed on your machine to run test locally

npm run samples:test

SauceLabs

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

distsrc

Points all of the package.jsons' 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

srcdist

Used to undo the changes made with distsrc.

npm run srcdist