Skip to content

Commit

Permalink
Add log tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shaunsaker committed Jun 10, 2018
1 parent e1a6991 commit 97714f6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions utils/app/log/__tests__/log.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import log from '../';

const data = {
string: 'string',
number: 1,
object: {
foo: 'bar',
},
array: ['foo', 'bar'],
};

it('should return the descriptor and data being logged as strings', () => {
expect(log('test', data)).toEqual({
descriptor: 'test',
data: JSON.stringify(data),
});
});

it('should return the descriptor and no data if no data is being logged', () => {
expect(log('test', null)).toEqual({
descriptor: 'test',
data: JSON.stringify(null),
});
});

0 comments on commit 97714f6

Please sign in to comment.