Permalink
Browse files

test-profile: put back old profile after test running.

  • Loading branch information...
1 parent 0de99bd commit 9e972030864d65bc3a5ecb7d5bd41f9be4e531f7 @bnjbvr committed Apr 9, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 example/test-profile.js
View
@@ -18,6 +18,8 @@ fs.readFile( 'credentials.user.js', function(err, data) {
client.profile.getSpecific('basic', {}, function(err, profile) {
if(err) { console.error( err ); return; }
+ var profileText = JSON.stringify(profile)
+ var oldProfile = JSON.parse( profileText ); // deep copy
console.log('Basic profile: ' + JSON.stringify(profile));
var newProfile = profile;
@@ -27,7 +29,6 @@ fs.readFile( 'credentials.user.js', function(err, data) {
if(err) { console.error('ERROR: '+ err ); return; }
console.log('Enhanced updated profile: ' + JSON.stringify(enhancedProfile) );
- var oldProfile = enhancedProfile[ client.profile.TYPES.basic.url ];
client.profile.delete('basic', {}, function(err) {
if(err) { console.error( err ); return; }

0 comments on commit 9e97203

Please sign in to comment.