Skip to content

Commit

Permalink
Add test for single column heading with text elsewhere in template st…
Browse files Browse the repository at this point in the history
…ring
  • Loading branch information
mattphillips committed Aug 1, 2019
1 parent b3b66cd commit d8ea37f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/jest-each/src/__tests__/template.test.ts
Expand Up @@ -142,6 +142,27 @@ describe('jest-each', () => {
);
});

test('does not throw error when there is only one column with additional words in template after heading', () => {
const globalTestMocks = getGlobalTestMocks();
const eachObject = each.withGlobal(globalTestMocks)`
a
hello world
${1}
`;
const testFunction = get(eachObject, keyPath);
const testCallBack = jest.fn();
testFunction('test title', testCallBack);

const globalMock = get(globalTestMocks, keyPath);

expect(globalMock).toHaveBeenCalledTimes(1);
expect(globalMock).toHaveBeenCalledWith(
'test title',
expectFunction,
undefined,
);
});

test('throws error when there are no arguments for given headings', () => {
const globalTestMocks = getGlobalTestMocks();
const eachObject = each.withGlobal(globalTestMocks)`
Expand Down

0 comments on commit d8ea37f

Please sign in to comment.