Skip to content

Commit

Permalink
Apply the review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
lekterable committed Oct 13, 2019
1 parent 8d638f0 commit 350e8ea
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/jest-reporters/src/__tests__/get_result_header.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,22 @@ const testResult = {

const globalConfig = makeGlobalConfig();

test('should call `terminal-link` correctly', () => {
beforeEach(() => {
terminalLink.mockClear();
});

test('should call `terminal-link` correctly', () => {
getResultHeader(testResult, globalConfig);
const call = terminalLink.mock.calls[0];

expect(terminalLink).toHaveBeenCalled();
expect(call[0]).toBe(formatTestPath(globalConfig, testResult.testFilePath));
expect(call[1]).toBe(`file://${testResult.testFilePath}`);
expect(terminalLink).toBeCalledWith(
formatTestPath(globalConfig, testResult.testFilePath),
`file://${testResult.testFilePath}`,
expect.objectContaining({fallback: expect.any(Function)}),
);
});

test('should render the output correctly', () => {
test('should render the terminal link', () => {
const result = getResultHeader(testResult, globalConfig);

expect(result).toMatch(/wannabehyperlink/);
expect(result).toContain('wannabehyperlink');
});

0 comments on commit 350e8ea

Please sign in to comment.