-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_new.js
More file actions
34 lines (31 loc) · 799 Bytes
/
test_new.js
File metadata and controls
34 lines (31 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Created by Administrator on 2015/6/17.
*/
var should = require('should');
//var assert = require('assert');
var Q = require('q');
var query = function(sql) {
var deferred = Q.defer();
if(sql) {
deferred.resolve(1);
} else {
deferred.reject(-1);
}
return deferred.promise;
}
describe('Testing Group', function() {
describe('Testing Group 1', function() {
it('should return -1', function () {
return query().fail(function(data){
data.should.equal(-1);
});
});
});
describe('Testing Group 2', function() {
it('should return 1', function () {
return query('anything').then(function (data) {
data.should.equal(1);
});
});
});
});