Skip to content

Commit

Permalink
test(TypingTitle): setup mock for typed.js module
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Aug 8, 2021
1 parent 96fbcab commit 754029c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/TypingTitle/TypingTitle.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@ import React from 'react';
import { create } from 'react-test-renderer';
import TypingTitle from './TypingTitle';

jest.mock('typed.js');

const landingTitles = [`I'm a coder.`, `I'm a learner.`];

describe('TypingTitle', () => {
test('should render correctly (snapshot)', () => {
const tree = create(<TypingTitle titles={landingTitles} />).toJSON();
const renderer = create(<TypingTitle titles={landingTitles} />);
const tree = renderer.toJSON();
expect(tree).toMatchSnapshot();
renderer.unmount();
});
});

0 comments on commit 754029c

Please sign in to comment.