Skip to content
/ Next14 Public

Next-14 template configured with typescript, eslint, prettier, husky (pre-commit), storybook, prisma, jest, testing-library and more...

Notifications You must be signed in to change notification settings

Aleydon/Next14

Repository files navigation

🌎 Next 14 Template 🌎


logo of Next14 repository

📌 Requirements: 📌

NodeJs: 🔗 https://nodejs.org/en/


▶️ Get Started:

  1. Clone this repo
git clone https://github.com/Aleydon/Next14.git
  1. Install NPM packages
npm install or yarn install
  1. Run this project
npm run dev or yarn dev

Template configuration:


Tests + Storybook:

  • How to run tests:
npm run test or npm run test:watch

It has an example of tests with Jest + Testing-Library in src/app/page.spec.tsx

import { render, screen } from '@testing-library/react';

import Page from './page';

describe('Page Component', () => {
  it('should get the text hello world', () => {
    render(<Page />);
    const hello = screen.getByText('Hello World');
    expect(hello).toBeDefined();
  });

  it('should get the text hello world in the component s heading', () => {
    render(<Page />);
    const heading = screen.getByRole('heading', {
      name: 'Hello World'
    });
    expect(heading).toBeInTheDocument();
  });

  it('must get the link from the page component', () => {
    render(<Page />);
    const link = screen.getByRole('link', { name: 'github.com/Aleydon' });
    expect(link).toBeDefined();
    expect(link).toHaveAttribute('target', '_blank');
    expect(link).toHaveAttribute('aria-label', 'github.com/Aleydon');
  });
});

  • How to run storybook:
npm run storybook or yarn storybook


storybook running

also has an example of using Storybook in the Text component in src/app/components/Text/text.stories.tsx

import type { Meta, StoryObj } from '@storybook/react';

import Text, { type TextProps } from '.';

const text: Meta<typeof Text> = {
  component: Text,
  title: 'Components/Text'
};

export default text;

export const Small: StoryObj<TextProps> = {
  args: {
    size: 'small',
    children: 'Small Text'
  }
};

export const Medium: StoryObj<TextProps> = {
  args: {
    size: 'medium',
    children: 'Medium Text'
  }
};
export const Large: StoryObj<TextProps> = {
  args: {
    size: 'large',
    children: 'Large Text'
  }
};

About

Next-14 template configured with typescript, eslint, prettier, husky (pre-commit), storybook, prisma, jest, testing-library and more...

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published