Skip to content

Commit

Permalink
test timeout to 5000 ms
Browse files Browse the repository at this point in the history
project#get test added
project#self test added
  • Loading branch information
yitsushi committed Mar 29, 2012
1 parent 4c326c5 commit 9ac0ba5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 16 deletions.
2 changes: 1 addition & 1 deletion test.js
@@ -1,6 +1,6 @@
var Mocha = require('mocha');

var mocha = new Mocha();
var mocha = new Mocha({ timeout: 5000 });
mocha.reporter('dot').ui('bdd');

files = [
Expand Down
54 changes: 39 additions & 15 deletions test/project-test.js
Expand Up @@ -5,25 +5,49 @@ var TeamLab = require('../teamlabapi'),

describe('project', function() {
var api;

beforeEach(function() {
var project = null;

beforeEach(function(done) {
api = new TeamLab(Config.domain);
api.authenticate(
Config.true_login.username,
Config.true_login.password,
function(err) {
done(err);
});
});

describe('#list', function() {
it('should return with a list of projects', function(done) {
api.authenticate(
Config.true_login.username,
Config.true_login.password,
function(err) {
should.not.exist(err);
api.project.all(function(err, data) {
should.not.exist(err);
should.exist(data);
assert(typeof data, typeof new Array());
done();
});
});
api.project.all(function(err, data) {
should.not.exist(err);
should.exist(data);
assert(typeof data, typeof new Array());
project = data[0];
done();
});
});
});

describe('#get', function() {
it('should return with a specified project', function(done) {
api.project.get(project.id, function(err, data) {
should.not.exist(err);
should.exist(data);
data.id.should.eql(project.id);
done();
});
});
});

describe('#self', function() {
it('should return with a list of projects in which the current user participates', function(done) {
api.project.self(function(err, data) {
should.not.exist(err);
should.exist(data);
assert(typeof data, typeof new Array());
done();
});
});
});
});

0 comments on commit 9ac0ba5

Please sign in to comment.