Skip to content

Commit

Permalink
chore: add test for the returned value
Browse files Browse the repository at this point in the history
  • Loading branch information
lekterable committed Oct 3, 2019
1 parent da3d6a7 commit 8d638f0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {formatTestPath} from '../utils';
import getResultHeader from '../get_result_header';
const terminalLink = require('terminal-link');

jest.mock('terminal-link', () => jest.fn());
jest.mock('terminal-link', () => jest.fn(() => 'wannabehyperlink'));

const testResult = {
testFilePath: '/foo',
Expand All @@ -28,3 +28,9 @@ test('should call `terminal-link` correctly', () => {
expect(call[0]).toBe(formatTestPath(globalConfig, testResult.testFilePath));
expect(call[1]).toBe(`file://${testResult.testFilePath}`);
});

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

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

0 comments on commit 8d638f0

Please sign in to comment.