Created
May 30, 2012 16:13
-
-
Save scarney81/2837339 to your computer and use it in GitHub Desktop.
Unit test example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*globals describe, beforeEach, it */ | |
var should = require('should'), | |
mockery = require('mockery'), | |
helpers = require('./helpers'), | |
Cache = require('../chatter-cache').ChatterCache; | |
describe('Chatter Cache', function() { | |
var proxy = null; | |
beforeEach(function(done) { | |
helpers.fetchProxy(function(err, data) { | |
if (err) return done(err); | |
proxy = data; | |
done(); | |
}); | |
}); | |
it('Can fetch users', function(done) { | |
var cache = new Cache(proxy); | |
cache.users(1, function(err, users) { | |
if (err) return done(err); | |
should.exist(users); | |
users.should.have.property('length'); | |
done(); | |
}); | |
}); | |
it('Can fetch mentions..', function(done) { | |
var cache = new Cache(proxy); | |
cache.mentions(1, function(err, mentions) { | |
if (err) return done(err); | |
should.exist(mentions); | |
mentions.should.have.property('length'); | |
done(); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment