---
title: "Discussion on \"How to create a Next.js project with TypeScript, Jest, React Testing Library and Test Renderer\" | Hashnode"
description: "Discussion on \"How to create a Next.js project with TypeScript, Jest, React Testing Library and Test Renderer\". First, create a TypeScript project with create-next-app using the --ts or --typescript flag like so:\nyarn create next-app --typescript\nor\nnpx create-next-app --ts\nAdd required libraries:\nyarn add -D jest @types/jest react-test-renderer @types/react-t..."
url: "https://hashnode.com/posts/how-to-create-a-nextjs-project-with-typescript-jest-react-testing-library-and-test-renderer/610589d333a2a43971a2d5d1"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to create a Next.js project with TypeScript, Jest, React Testing Library and Test Renderer](https://nightzen.hashnode.dev/how-to-create-a-nextjs-project-with-typescript-jest-react-testing-library-and-test-renderer?utm_source=hashnode&utm_medium=feed)

First, create a TypeScript project with create-next-app using the --ts or --typescript flag like so: yarn create next-app --typescript or npx create-next-app --ts Add required libraries: yarn add -D jest @types/jest react-test-renderer @types/react-t...

Jul 31, 2021 · 2 min read · nightzen.hashnode.dev  
Read the article

-   [#nextjs](https://hashnode.com/tag/nextjs)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#jest](https://hashnode.com/tag/jest)
-   [#testing-library](https://hashnode.com/tag/testing-library)
-   [#reactjs](https://hashnode.com/tag/reactjs)

## Written by

[Alexandr Yudenich](https://hashnode.com/@nightzen)

@nightzen

  
[View profile](https://hashnode.com/@nightzen)

Frontend Developer

## Responses 1

Markdown supported · ⌘↵ to post

[Murat](https://hashnode.com/@muratx10)

[Jan 22, 2022](https://hashnode.com/posts/how-to-create-a-nextjs-project-with-typescript-jest-react-testing-library-and-test-renderer/610589d333a2a43971a2d5d1/comment/61ebc7dda12088017fbe8fa1)

Maybe you know how to fix TS error

```
Property 'toBeInTheDocument' does not exist on type 'Matchers '.
```

I have the same config as yours and I have this error(

```
"jest": "^27.4.7",
"jest-environment-jsdom": "^27.4.6",
"typescript": "4.4.3",
"@types/jest": "^27.4.0",
"next": "^12.0.8",
```

Thanks in advance!
