Skip to content

Latest commit

 

History

History
132 lines (80 loc) · 2.61 KB

SCRIPTS.md

File metadata and controls

132 lines (80 loc) · 2.61 KB

Scripts

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

build

Build all packages.

yarn run build

Build a single package.

yarn run build:package @webex/webex-core

lint:js

Lint all JavaScript files.

yarn run lint:js

test

Options may be specified as switches or via environment variables.

Test all packages.

npm test

See all options.

yarn run test --help

Test a single package.

yarn run test --packages @webex/webex-core

Test a single package, but only in a browser.

yarn run test --packages @webex/webex-core --browser

Test a single package, but only in a specific browser.

BROWSER=chrome yarn run test --packages @webex/webex-core --browser

Test a single package and generate coverage and XUnit reports.

yarn run 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.

yarn run 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.

yarn run 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.

yarn run samples:test

Sauce Labs

The SDK uses Sauce Labs 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 Sauce Labs tunnel, run tests using Sauce Labs browsers, and stop the Sauce Labs tunnel:

# Run all tests on Sauce Labs with default configuration
SAUCE=true yarn run test

# Run the samples automation tests on Sauce Labs
SAUCE=true yarn run samples:test

# Run `plugin-teams` test suite on Sauce Labs only only Edge and IE 11
SAUCE=true yarn run test --packages @webex/plugin-teams --os Windows --browsers Edge IE

# Run all tests on Sauce Labs only with Chrome on Mac and Windows
SAUCE=true yarn 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.

yarn run distsrc

srcdist

Used to undo the changes made with distsrc.

yarn run srcdist