Skip to content

Commit e4615ef

Browse files
committed
升级浏览器端测试所使用的 mocha 到最新版本以支持 Promise
1 parent a548f1f commit e4615ef

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"gulp-sourcemaps": "^1.6.0",
3939
"gulp-tar": "^1.3.2",
4040
"gulp-uglify": "^1.0.2",
41-
"mocha": "1.9.0",
41+
"mocha": "2.4.5",
4242
"vinyl-source-stream": "^1.1.0"
4343
},
4444
"license": "MIT",

test/cloud.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@ describe("AV.Cloud", function() {
1818
});
1919

2020
describe("#getServerDate", function(){
21-
it("should return a date.", function(done){
22-
AV.Cloud.getServerDate().then(function(date) {
21+
it("should return a date.", function() {
22+
return AV.Cloud.getServerDate().then(function(date) {
2323
expect(date).to.be.a('object');
2424
expect(date instanceof Date).to.be(true);
25-
done();
26-
}).catch(function(err) {
27-
throw err;
2825
});
2926
});
3027
});

test/user.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,13 +283,15 @@ describe("User", function() {
283283
});
284284

285285
describe('currentUser disabled', function() {
286-
var user, originalUser;
286+
var user, originalUser, originalPromisesAPlusCompliant;
287287

288288
before(function() {
289289
originalUser = AV.User._currentUser;
290290
AV.User._currentUser = null;
291291
AV._config.disableCurrentUser = true;
292292
AV._useMasterKey = false;
293+
originalPromisesAPlusCompliant = AV.Promise._isPromisesAPlusCompliant;
294+
AV.Promise._isPromisesAPlusCompliant = true;
293295
});
294296

295297
var username = 'u' + Date.now();
@@ -346,6 +348,7 @@ describe("User", function() {
346348
AV._config.disableCurrentUser = false;
347349
AV._useMasterKey = true;
348350
AV.User._currentUser = originalUser;
351+
AV.Promise._isPromisesAPlusCompliant = originalPromisesAPlusCompliant;
349352
});
350353
});
351354
});

0 commit comments

Comments
 (0)