Skip to content

Commit

Permalink
Merge pull request #165 from leeyeh/master
Browse files Browse the repository at this point in the history
Test 迁移到美国节点
  • Loading branch information
leeyeh committed Nov 3, 2015
2 parents c2efc02 + 030b51e commit caaf115
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 32 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
language: node_js
node_js:
- "0.12"
- "4"
sudo: false
env:
global:
- REGION=us
- APP_ID=Ol0Cw6zL1xP9IIqJpiSv9uYC
- EXSITING_ROOM_ID=5638313660b28815a724df31
before_install:
- npm install bower grunt-cli -g
- bower install
Expand Down
28 changes: 14 additions & 14 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,9 @@ module.exports = function(grunt) {

var SAUCE_BROWSERS = [{
browserName: 'chrome'
}, {
browserName: 'firefox'
}, {
browserName: 'internet explorer',
version: '11.0'
}, {
browserName: 'internet explorer',
version: '10.0'
}, {
browserName: 'internet explorer',
version: '9.0'
}, {
browserName: 'internet explorer',
version: '8.0'
}];

var HINT_SRCS = ['src/**/*.js', 'test/**/*.js', 'demo/**/*.js', '*.js', '!**/*.browser.js'];
Expand Down Expand Up @@ -47,6 +36,9 @@ module.exports = function(grunt) {
test: {
files: {
'test/browser/specs.browser.js': 'test/specs.js'
},
options: {
transform: ['envify']
}
}
},
Expand Down Expand Up @@ -89,7 +81,9 @@ module.exports = function(grunt) {
urls: ['http://localhost:8000/test/browser/'],
build: process.env.CI_BUILD_NUMBER,
testname: 'Sauce Test for LeanCloud realtime SDK',
browsers: SAUCE_BROWSERS
browsers: SAUCE_BROWSERS,
throttled: 3,
tunnelArgs: ['--vm-version', 'dev-varnish']
}
}
},
Expand All @@ -107,8 +101,14 @@ module.exports = function(grunt) {
});
grunt.registerTask('default', []);
grunt.registerTask('hint', ['jshint', 'jscs']);
grunt.registerTask('test', ['hint', 'babel', 'browserify:test', 'connect', 'mocha_phantomjs', 'simplemocha']);
grunt.registerTask('sauce', ['browserify:test', 'connect', 'saucelabs-mocha']);
grunt.registerTask('sauce', ['babel', 'browserify:test', 'connect', 'saucelabs-mocha']);
grunt.registerTask('test', '', function() {
var tasks = ['hint', 'babel', 'browserify:test', 'connect', /*'mocha_phantomjs',*/ 'simplemocha'];
if (process.env.RUN_SAUCE) {
tasks.push('saucelabs-mocha');
}
grunt.task.run(tasks);
});
grunt.registerTask('release', ['babel', 'browserify:dist', 'uglify:dist']);
grunt.registerTask('dev', ['hint', 'release', 'connect', 'watch']);
};
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
* 在目录中执行 `bower install` 安装所需 Web 依赖库
* 执行 `grunt dev` 浏览器打开 http://localhost:8000 本地进行调试
* 修改 `src` 目录中的源码,系统会自动生成调试代码
* `grunt release` 打包生成 dist
* 确保 `grunt test` 的测试全部 pass
* 提交并发起 PR

其他说明:`grunt dev` 会监听每次 `src` 目录中的改动,自动进行 `grunt release` 打包操作,不需要再手动执行一次。
* 提交改动并发起 PR,请不要提交 dist 与 lib 下的变动

项目的目录结构说明如下:
```
Expand Down Expand Up @@ -44,6 +41,6 @@
* 修改 changelog.md
* `grunt test`
* `grunt release` and commit all changed files
* 提交 PR 到 master
* (merge 后)Github 生成 release 包(for bower)
* push to master
* GitHub 生成 release 包(for bower)
* 发布到 npm(`npm publish`,需 npm 协作者身份)
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leancloud-realtime",
"version": "2.3.0",
"version": "2.3.1",
"homepage": "http://github.com/leancloud/js-realtime-sdk/",
"authors": [
"WangXiao <[email protected]>"
Expand Down
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.3.1
### Features
* 支持接收自定义类型消息

### Bug Fixes
* 修复一个可能导致签名校验失败的 bug

## 2.3.0
### Features
* 增加 `invited`, `kicked`, `membersjoined`, `membersleft` 事件,废弃 `join`, `left` 事件
Expand Down
2 changes: 1 addition & 1 deletion dist/AV.realtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var ajax = tool.ajax;
var extend = tool.extend;

// 当前版本
var VERSION = '2.3.0';
var VERSION = '2.3.1';

// 配置项
var config = {
Expand Down
2 changes: 1 addition & 1 deletion dist/AV.realtime.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/realtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var ajax = tool.ajax;
var extend = tool.extend;

// 当前版本
var VERSION = '2.3.0';
var VERSION = '2.3.1';

// 配置项
var config = {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leancloud-realtime",
"version": "2.3.0",
"version": "2.3.1",
"description": "LeanCloud Realtime Message JavaScript SDK",
"main": "lib/realtime.js",
"directories": {
Expand All @@ -24,6 +24,7 @@
},
"homepage": "https://leancloud.cn/",
"devDependencies": {
"envify": "^3.4.0",
"es6-promise": "^3",
"grunt": "^0.4.5",
"grunt-babel": "^5.0",
Expand Down
2 changes: 1 addition & 1 deletion src/realtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var ajax = tool.ajax;
var extend = tool.extend;

// 当前版本
var VERSION = '2.3.0';
var VERSION = '2.3.1';

// 配置项
var config = {
Expand Down
15 changes: 10 additions & 5 deletions test/specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ var sinon = require('sinon');
require('should-sinon');

// 请将 AppId 改为你自己的 AppId
var appId = 'anruhhk6visejjip57psvv5uuv8sggrzdfl9pg2bghgsiy35';
var APP_ID = process.env.APP_ID || 'anruhhk6visejjip57psvv5uuv8sggrzdfl9pg2bghgsiy35';
var REGION = process.env.REGION;

var convName = 'js-realtime-sdk-testconv';

Expand All @@ -31,13 +32,15 @@ before(function(done) {
Promise.all([
new Promise(function(resolve) {
rt = realtime({
appId: appId,
appId: APP_ID,
region: REGION,
clientId: 'js-realtime-sdk-test-client1'
}, resolve);
}),
new Promise(function(resolve) {
rt2 = realtime({
appId: appId,
appId: APP_ID,
region: REGION,
clientId: 'js-realtime-sdk-test-client2'
}, resolve);
})
Expand All @@ -61,7 +64,8 @@ describe('realtime', function() {
Promise.all([
new Promise(function(resolve) {
rt3 = realtime({
appId: appId,
appId: APP_ID,
region: REGION,
clientId: 'js-realtime-sdk-test-client-for-init'
}, resolve);
}),
Expand Down Expand Up @@ -139,7 +143,8 @@ describe('RealtimeObject', function() {
}).should.throw();
});
it('fetch an exsiting room', function(done) {
rt.room('559d08a1e4b0a35bc5062ba1', function(room) {
var id = process.env.EXSITING_ROOM_ID || '559d08a1e4b0a35bc5062ba1';
rt.room(id, function(room) {
room.should.have.properties(['id', 'name', 'attr']);
done();
});
Expand Down

0 comments on commit caaf115

Please sign in to comment.