$ npm run build
$ npm run watch
$ npm test
$ npm run mocha
$ npm run mocha-watch
$ npm run istanbul
$ npm run karma
$ npm run karma-watch
$ npm run karma-webpack
$ npm run karma-webpack-watch
Attention Repository follows the GitHub Flow.
The SDK will be used in a variety of different third-party applications, which means it has to be written with the lowest amount of dependencies. Please do not include anything external if there is no proper justification.
- All AJAX interaction must be mocked
- No direct SDK's method overrides in tests
It is forbidden to use variables to determine, whether callback was executed or not. The following code IS NOT OK:
```js
var wasCalled = false,
callParameter = null;
callback = function(e){ wasCalled = true; callParameter = e; };
foo.bar({success: callback});
expect(wasCalled).to.be.true;
expect(callParameter).to.be.equal(...);
```
The way it should be done:
```js
var spy = chai.spy(function(e){ expect(e).to.be.equal(...); }); // expectation in callback
foo.bar({success: spy});
expect(spy).to.be.called.once(); // expectation that spy was called
```
These tests access real account on real production/staging servers. In order to make things happen a proper environment variables have to be defined:
RCSDK_API_KEY=YOUR_API_KEY
RCSDK_API_SERVER=http://platform.ringcentral.com
RCSDK_AGS_SERVER=http://ags-server-host
RCSDK_AGS_DBNAME=database
Once ready run the following command:
$ npm run test-api
Environment variables may also be defined inline (substitute (...)
with more vars):
$ RCSDK_API_KEY=YOUR_API_KEY (...) RCSDK_AGS_DBNAME=database npm run test-api
-
Canary release — commit to master, CI will do the rest, alternatively you may publish locally:
$ npm run publish:canary
-
Pre release:
$ npm run prepare:prerelease [-- --yes --no-git-tag-version --no-push]
This command will run
lerna version prerelease
to update versions and push to git with appropriate tag, tag will be picked up by CI and actual publish will happen (lerna publish
). -
Versioned release:
$ npm run prepare:release [-- --yes --no-git-tag-version --no-push]
This command will run
lerna version
to update versions and push to git with appropriate tag, tag will be picked up by CI and actual publish will happen (lerna publish
). -
Manual publish — run publishing locally, it assumes you already prepared your release:
$ npm run publish:fromgit
Keep in mind that CI will fail because it will try to publish on top of your already published tags.