Skip to content

Commit

Permalink
fix: lint (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
JFeremy committed Sep 7, 2023
2 parents 5f19ee4 + 814930c commit 8448499
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

https://www.typescriptlang.org/tsconfig

## ICONS

https://www.s-ings.com/typicons/

## SITE MAP

## SITE MAP
https://github.com/iamvishnusankar/next-sitemap#readme

## TESTS

https://dev.to/peterlidee/-mocking-usesearchparams-and-userouter-with-jest-in-next-13-nextnavigation-15bd

https://dev.to/peterlidee/how-to-mock-next-router-with-jest-3p6b
2 changes: 1 addition & 1 deletion jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import '@testing-library/jest-dom';
import '@testing-library/jest-dom';
10 changes: 5 additions & 5 deletions src/app/layout.test.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { render, screen } from '@testing-library/react';
import renderer from 'react-test-renderer';

import { TLocale } from '@/interfaces';

import RootLayout, { generateStaticParams } from './layout';

describe('RootLayout', () => {

describe('Layout', () => {
it('component matches snapshot', async () => {
const params = { lang: 'fr' as TLocale };
const text = 'root layout test';

const tree = renderer
.create(<RootLayout params={params}>
<div>{text}</div>
</RootLayout>)
.create(
<RootLayout params={params}>
<div>{text}</div>
</RootLayout>,
)
.toJSON();
expect(tree).toMatchSnapshot();
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { i18n } from '#i18n';

import { AnybodyFont, FiraCodeFont } from './_styles/font';

export async function generateStaticParams (): Promise<IStaticParams[]> {
export async function generateStaticParams(): Promise<IStaticParams[]> {
return i18n.locales.map((locale) => ({ lang: locale }));
}

Expand Down
4 changes: 0 additions & 4 deletions src/utils/translate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ describe('getPageTranslation', () => {
});
});

afterAll(() => {
delete langPages['testPage' as unknown as TPage];
});

it('should return page translation for a given locale', () => {
const translations = getPageTranslation(
'fr',
Expand Down

0 comments on commit 8448499

Please sign in to comment.