Skip to content

Commit

Permalink
test: add formatMessage tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blackxored committed Nov 15, 2017
1 parent c77b2c7 commit c1fbd02
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/__tests__/__snapshots__/formatMessage.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`formatMessage returns a list of strings suitable for console logging 1`] = `
Array [
"%c apollo %cquery %cFormatMessageQuery %c(in 1000 ms)",
]
`;

exports[`formatMessage returns a list of strings suitable for console logging 2`] = `
Array [
"%c apollo %cmutation %cFormatMessageMutation %c(in 500 ms)",
]
`;
17 changes: 17 additions & 0 deletions src/__tests__/formatMessage.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const formatMessage = require('../formatMessage');

describe('formatMessage', () => {
it('returns a list of strings suitable for console logging', () => {
expect(
formatMessage('query', { operationName: 'FormatMessageQuery' }, 1000),
).toMatchSnapshot();

expect(
formatMessage(
'mutation',
{ operationName: 'FormatMessageMutation' },
500,
),
).toMatchSnapshot();
});
});

0 comments on commit c1fbd02

Please sign in to comment.