Permalink
Browse files

Updated tests; ready for v0.2.0 release

  • Loading branch information...
1 parent a46dfdd commit f15981c7e54bce55159fd8e1a60d8c57236c3f64 @clintandrewhall committed Jan 4, 2013
Showing with 34 additions and 35 deletions.
  1. +6 −6 lib/core.js
  2. +1 −2 package.json
  3. +4 −4 test/config-sample.js
  4. +5 −5 test/events-test.js
  5. +11 −11 test/lists-test.js
  6. +3 −3 test/photos-test.js
  7. +4 −4 test/settings-test.js
View
@@ -50,12 +50,12 @@ module.exports = function(config) {
var path = parsedUrl.pathname + '?' + qs.stringify(parsedUrl.query);
logger.debug('retrieve: Request path: ' + path);
request = https.request({
- "host" : parsedUrl.hostname,
- "port" : parsedUrl.port,
- "path" : path,
- "method" : method,
- "headers" : {
- "Content-Length": 0
+ 'host' : parsedUrl.hostname,
+ 'port' : parsedUrl.port,
+ 'path' : path,
+ 'method' : method,
+ 'headers' : {
+ 'Content-Length': 0
}
}, function(res) {
res.on('data', function(chunk) {
View
@@ -27,14 +27,13 @@
}
],
"dependencies": {
- "nconf": "0.6.x",
"winston": "0.6.x"
},
"devDependencies": {
"express": "2.5.x"
},
"engines": {
- "node": ">= 0.6.x"
+ "node": ">= 0.8.x"
},
"homepage": "https://github.com/clintandrewhall/node-foursquare",
"author": "Clint Andrew Hall (http://www.clintandrewhall.com)",
View
@@ -1,9 +1,9 @@
// sign up at https://foursquare.com/oauth/register
// copy this file to config.js and edit the values below
module.exports = {
- "secrets" : {
- "clientId" : "YOUR_ID",
- "clientSecret" : "YOUR_SECRET",
- "redirectUrl" : "http://localhost:3000/callback" // This should also be set in your OAuth profile.
+ 'secrets' : {
+ 'clientId' : 'YOUR_ID',
+ 'clientSecret' : 'YOUR_SECRET',
+ 'redirectUrl' : 'http://localhost:3000/callback' // This should also be set in your OAuth profile.
}
};
View
@@ -8,16 +8,16 @@ var EventsTests = function(config, accessToken) {
return {
getEvent : function() {
- var test = "Foursquare.Events.getEvent(4e173d2cbd412187aabb3c04)";
- Foursquare.Events.getEvent("4e173d2cbd412187aabb3c04", accessToken, function (error, data) {
+ var test = 'Foursquare.Events.getEvent(4e173d2cbd412187aabb3c04)';
+ Foursquare.Events.getEvent('4e173d2cbd412187aabb3c04', accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);
}
else {
try {
testUtil.reportData(logger, test, util.inspect(data));
assert.ok(data.event);
- assert.ok(data.event.id == "4e173d2cbd412187aabb3c04");
+ assert.ok(data.event.id == '4e173d2cbd412187aabb3c04');
testUtil.reportOk(logger, test);
} catch (error) {
testUtil.reportError(logger, test, error);
@@ -27,7 +27,7 @@ var EventsTests = function(config, accessToken) {
},
getCategories : function() {
- var test = "Foursquare.Events.getCategories()";
+ var test = 'Foursquare.Events.getCategories()';
Foursquare.Events.getCategories(null, accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);
@@ -46,7 +46,7 @@ var EventsTests = function(config, accessToken) {
},
search : function() {
- var test = "Foursquare.Events.search(domain=songkick.com,eventId=8183976)",
+ var test = 'Foursquare.Events.search(domain=songkick.com,eventId=8183976)',
params = {
'domain' : 'songkick.com',
'eventId' : '8183976'
View
@@ -8,16 +8,16 @@ var ListsTests = function(config, accessToken) {
return {
getList : function() {
- var test = "Foursquare.Lists.getList(4e4e804fd22daf51d267e1dd)";
- Foursquare.Lists.getList("4e4e804fd22daf51d267e1dd", accessToken, function (error, data) {
+ var test = 'Foursquare.Lists.getList(4e4e804fd22daf51d267e1dd)';
+ Foursquare.Lists.getList('4e4e804fd22daf51d267e1dd', accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);
}
else {
try {
testUtil.reportData(logger, test, util.inspect(data));
assert.ok(data.list);
- assert.equal(data.list.id, "4e4e804fd22daf51d267e1dd");
+ assert.equal(data.list.id, '4e4e804fd22daf51d267e1dd');
testUtil.reportOk(logger, test);
} catch (error) {
testUtil.reportError(logger, test, error);
@@ -27,8 +27,8 @@ var ListsTests = function(config, accessToken) {
},
getFollowers : function() {
- var test = "Foursquare.Lists.getFollowers(4e4e804fd22daf51d267e1dd)";
- Foursquare.Lists.getFollowers("4e4e804fd22daf51d267e1dd", accessToken, function (error, data) {
+ var test = 'Foursquare.Lists.getFollowers(4e4e804fd22daf51d267e1dd)';
+ Foursquare.Lists.getFollowers('4e4e804fd22daf51d267e1dd', accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);
}
@@ -46,8 +46,8 @@ var ListsTests = function(config, accessToken) {
},
getSuggestedPhotos : function() {
- var test = "Foursquare.Lists.getSuggestedPhotos(4e4e804fd22daf51d267e1dd, v4bc49ceff8219c74ea97b710)";
- Foursquare.Lists.getSuggestedPhotos("4e4e804fd22daf51d267e1dd", "v4bc49ceff8219c74ea97b710", accessToken, function (error, data) {
+ var test = 'Foursquare.Lists.getSuggestedPhotos(4e4e804fd22daf51d267e1dd, v4bc49ceff8219c74ea97b710)';
+ Foursquare.Lists.getSuggestedPhotos('4e4e804fd22daf51d267e1dd', 'v4bc49ceff8219c74ea97b710', accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);
}
@@ -70,8 +70,8 @@ var ListsTests = function(config, accessToken) {
},
getSuggestedTips : function() {
- var test = "Foursquare.Lists.getSuggestedTips(4e4e804fd22daf51d267e1dd, v4bc49ceff8219c74ea97b710)";
- Foursquare.Lists.getSuggestedPhotos("4e4e804fd22daf51d267e1dd", "v4bc49ceff8219c74ea97b710", accessToken, function (error, data) {
+ var test = 'Foursquare.Lists.getSuggestedTips(4e4e804fd22daf51d267e1dd, v4bc49ceff8219c74ea97b710)';
+ Foursquare.Lists.getSuggestedPhotos('4e4e804fd22daf51d267e1dd', 'v4bc49ceff8219c74ea97b710', accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);
}
@@ -94,8 +94,8 @@ var ListsTests = function(config, accessToken) {
},
getSuggestedVenues : function() {
- var test = "Foursquare.Lists.getSuggestedVenues(4e4e804fd22daf51d267e1dd)";
- Foursquare.Lists.getSuggestedVenues("4e4e804fd22daf51d267e1dd", accessToken, function (error, data) {
+ var test = 'Foursquare.Lists.getSuggestedVenues(4e4e804fd22daf51d267e1dd)';
+ Foursquare.Lists.getSuggestedVenues('4e4e804fd22daf51d267e1dd', accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);
}
View
@@ -8,16 +8,16 @@ var PhotosTests = function(config, accessToken) {
return {
getPhoto : function() {
- var test = "Foursquare.Photos.getPhoto(4d0fb8162d39a340637dc42b)";
- Foursquare.Photos.getPhoto("4d0fb8162d39a340637dc42b", accessToken, function (error, data) {
+ var test = 'Foursquare.Photos.getPhoto(4d0fb8162d39a340637dc42b)';
+ Foursquare.Photos.getPhoto('4d0fb8162d39a340637dc42b', accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);
}
else {
try {
testUtil.reportData(logger, test, util.inspect(data));
assert.ok(data.photo);
- assert.equal(data.photo.id, "4d0fb8162d39a340637dc42b");
+ assert.equal(data.photo.id, '4d0fb8162d39a340637dc42b');
testUtil.reportOk(logger, test);
} catch (error) {
testUtil.reportError(logger, test, error);
View
@@ -8,15 +8,15 @@ var SettingsTest = function(config, accessToken) {
return {
getSetting : function() {
- var test = "Foursquare.Settings.getSetting('receivePings')";
- Foursquare.Settings.getSetting("receivePings", accessToken, function (error, data) {
+ var test = 'Foursquare.Settings.getSetting(\'receivePings\')';
+ Foursquare.Settings.getSetting('receivePings', accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);
}
else {
try {
testUtil.reportData(logger, test, util.inspect(data));
- assert.ok(typeof data.value !== "undefined");
+ assert.ok(typeof data.value !== 'undefined');
testUtil.reportOk(logger, test);
} catch (error) {
testUtil.reportError(logger, test, error);
@@ -26,7 +26,7 @@ var SettingsTest = function(config, accessToken) {
},
getSettings : function() {
- var test = "Foursquare.Settings.getSettings()";
+ var test = 'Foursquare.Settings.getSettings()';
Foursquare.Settings.getSettings(accessToken, function (error, data) {
if(error) {
testUtil.reportError(logger, test, error.message);

0 comments on commit f15981c

Please sign in to comment.