Integration common javascript core library. In this project we aim to:
- Refactor and converge all integration js code bases into a common package.
- Utilize official ringcentral js sdk libraries as much as possible.
- Server-side test framework setup
- Browser-side test framework setup
- Coding style guide document
- Eslint check setup
- Webpack setup for distributing code
- CI setup
#To start
-
Install dependencies
npm install
-
Create accounts.json
{ "app": { "appKey": "${your app key}", "appSecret": "${your app secret}" }, "apiServer": "${apiServer address}", "brand": { "name": "${brand name}", "id": "${brand id}" }, "user": { "username": "${RingCentral sandbox account username}", "extension": "${RingCentral sandbox account extension}", "password": "${RingCentral sandbox account password}" } }
#Coding Style
Please refer to airbnb/javascript. We will use the recommended linter settings and jscs settings, and adjust as we progress.
Also refer to .eslintrc for our own overrides.
#Linting
npm run eslint
npm install -g eslint babel-eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react
-
SublimeText
Install sublime package control from packagecontrol.io
Required Packages: * SublimeLinter * SublimeLinter-contrib-eslint * EditorConfig Recommended Pakcages: * Babel * GitGutter
Linting should happen on file write.
-
VSCode
Required Extensions: * ESLint * EditorConfig for VS Code Recommended Extensions: * Babel ES6/ES7
The linting errors and warnings should show as ~~~ under the code.
#Tests
Run all tests:
npm run test
Run tests in specific test folder or file:
npm run quick-test -- --folder folder1 --folder folder2,folder3
npm run quick-test -- --folder test/lib
npm run quick-test -- --file test/lib/add-module.test.js
Both multiple --folder/--file declaration, or comma-delimmated list will work too.
#Test in Browsers
npm run test-Browser
Open localhost:8190 in your browser to run the tests.
#Contribution
Please fork and contribute via PR.