The easiest way to get started with Next.js is by using create-next-app
npx create-next-app@14.0.4
To install yarn. Yarn is a package manager similar to npm
npm install -g yarn
To check your yarn version
yarn --version
To avoid conflict with storybook and jest
yarn set version stable
Delete package-lock.json file, and run the following command to create yarn-lock file
yarn
! Add .yarn in gitignore file to avoid pushing the unneccessary files
To run the file
yarn dev
To install testing libraries
yarn add @testing-library/jest-dom @testing-library/react @testing-library/user-event jest jest-environment-jsdom ts-jest
Add the following to scripts in package.json
"test":"jest --coverage",
"test:watch":"jest --watchAll"
Add Jest config file in root directory as jest.config.js
Add Jest setup file in root directory as jest.setup.js
- Go to the github repository
- Go to Actions tab
- Choose Workflow. Under Continuous Integration, choose Node JS
- Change the yml file name and commit changes
- Pull the changes to local
- Make the neccessary changes