Skip to content

Commit

Permalink
Merge pull request #1 from flovilmart/logging
Browse files Browse the repository at this point in the history
Better password stripping tests
  • Loading branch information
spenthil authored Jul 15, 2016
2 parents 7ed9a7d + be22ef1 commit bc09f88
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions spec/FileLoggerAdapter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ describe('verbose logs', () => {
level: 'verbose'
});
}).then((results) => {
expect(results[1].body.password).toEqual("********");
let logString = JSON.stringify(results);
expect(logString.match(/\*\*\*\*\*\*\*\*/g).length).not.toBe(0);
expect(logString.match(/moon-y/g)).toBe(null);

var headers = {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest'
Expand All @@ -74,11 +77,16 @@ describe('verbose logs', () => {
size: 100,
level: 'verbose'
}).then((results) => {
expect(results[1].url.includes('password=********')).toEqual(true);
let logString = JSON.stringify(results);
expect(logString.match(/\*\*\*\*\*\*\*\*/g).length).not.toBe(0);
expect(logString.match(/moon-y/g)).toBe(null);
done();
});
});
});
}).catch((err) => {
fail(JSON.stringify(err));
done();
})
});

it("should not mask information in non _User class", (done) => {
Expand Down

0 comments on commit bc09f88

Please sign in to comment.