Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
test: move test-utils
Browse files Browse the repository at this point in the history
Signed-off-by: Logan McAnsh <[email protected]>
  • Loading branch information
mcansh committed Mar 22, 2020
1 parent 0244e0f commit aeece2a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = {
{
devDependencies: [
'__tests__/**/*',
'utils/render-with-intl.tsx',
'test-utils/index.tsx',
'scripts/**/*',
'types/jest-dom.d.ts',
'next.config.js',
Expand Down
2 changes: 1 addition & 1 deletion __tests__/components/header/date.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { subMonths } from 'date-fns';

import { render } from '~/utils/render-with-intl';
import { render } from '~/test-utils';
import DateHeading from '~/components/header/date';

it('shows x time ago if < 4 months ago', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/components/header/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';

import { render } from '~/utils/render-with-intl';
import { render } from '~/test-utils';
import Header from '~/components/header';

describe('Header Component', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/components/post-card.test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

import PostCard, { Post } from '~/components/post-card/index';
import { render } from '~/utils/render-with-intl';
import { render } from '~/test-utils';

const post: Post = {
date: '2019-02-02T00:00:00',
Expand Down
6 changes: 2 additions & 4 deletions utils/render-with-intl.tsx → test-utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import { render } from '@testing-library/react';

import theme from '~/config';

const renderWithIntl = (children: React.ReactNode) =>
const renderWithTheme = (children: React.ReactNode) =>
render(
<ThemeProvider theme={theme}>
<>{children}</>
</ThemeProvider>
);

export * from '@testing-library/react';
export { renderWithIntl as render };

export default renderWithIntl;
export { renderWithTheme as render };

0 comments on commit aeece2a

Please sign in to comment.