dev + it dev jest mock [JEST] ๐ ๋ชจํน Mocking ์ ๋ฆฌ - jest.fn / jest.mock /jest.spyOnMocking ์๋ฆฌ mocking์ด๋ (mock = ๋ชจ์กฐํ) ๋ป ๊ทธ๋๋ก ๋ฐ์๋๋ฆฌ๋ฉด ๋๋ค. ์ฆ ํ ์คํธํ๊ณ ์ ํ๋ ์ฝ๋๊ฐ ์์กดํ๋ function์ด๋ class์ ๋ํด ๋ชจ์กฐํ์ ๋ง๋ค์ด '์ผ๋จ' ๋์๊ฐ๊ฒ ํ๋ ๊ฒ์ด๋ค. ํ๋ง๋๋ก, ๋จ์ ํ ์คํธ๋ฅผ ์์ฑํ ๋, ํด๋น ์ฝ๋๊ฐ ์์กดํ๋ ๋ถ๋ถ์ ๊ฐ์ง(mock)๋ก ๋์ฒดํ๋ ๊ธฐ๋ฒ์ ๋งํ๋ค. ์ ๊ฐ์ง๋ก ๋์ฒดํ๋๊ฐ? ํ ์คํธ ํ๊ณ ์ถ์ ๊ธฐ๋ฅ์ด ๋ค๋ฅธ ๊ธฐ๋ฅ๋ค๊ณผ ์ฎ์ฌ์์ ๊ฒฝ์ฐ(์์กด) ์ ํํ ํ ์คํธ๋ฅผ ํ๊ธฐ ํ๋ค๊ธฐ ๋๋ฌธ์ด๋ค. ์๋ฅผ๋ค์ด request body์ ์ฌ์ฉ์์ id์ password๋ฅผ ๋ฃ์ด์ post์์ฒญ์ ๋ณด๋ด๋ฉด ์ปจํธ๋กค๋ฌ์์ ์ ๋ณด๋ฅผ ์ถ์ถํ ํ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋ฃ์ด์ฃผ๋ ๋จ์ํ ์คํธ๋ฅผ ํ๊ณ ์ถ๋ค๊ณ ํ์. ์ปจํธ๋กค๋ฌ๋ ๋ผ์ฐํฐ์์ ์๋ต์ ๋ณด๋ด๋ ๋ฏธ๋ค์จ์ด๋ฅผ ํน๋ณํ ๋ถ๋ฅด๋ ๋ง์ด๋ค. ๊ทธ๋ฅ ํจ์๋ค. ๋ฐ.. wono | discuss | tweet + it dev nextjs jest prisma Next.js, Prisma, Jestใงใตใผใใผใตใคใใฎใในใใใใ wono | discuss | tweet + it dev nextjs NextJs best boiler plateBest Boilerplate and Starter for Next.js with App Router support, Tailwind CSS, and TypeScript. โNextJs best boiler plateโ is published by Mahernaija. wono | discuss | tweet + it dev vitest prisma Next.js(App Router)ใงไฝใฃใTODOใขใใชใซVitestใงใในใใ่ฟฝๅ ใใพใใ wono | discuss | tweet + it dev jest prisma Unit testing with Prisma ORM | Prisma DocumentationLearn how to setup and run unit tests with Prisma Client wono | discuss | tweet + it dev vitest Simple Unit Testing with Vitest: NextJS AppUnit testing considers only a unit in an isolated environment whereas there could be a block of code a.k.a function, or component. For better understanding, I will create a simple project toโฆ wono | discuss | tweet + it dev vitest How to Mock Fetch API in VitestIn this article, we will learn how to mock the fetch API in Vitest in a to-do list service file. we will use the global along with vi.fn(). wono | discuss | tweet + it dev nextjs api Next.jsใฎAPIใซใผใใใในใใใ wono | discuss | tweet + it dev nextjs jest NextJs 14 โ App Router and Unit Testing (w/ async pages)Unit-test in NextJs14 using JEST with practical examples. wono | discuss | tweet + it dev nextjs NextJS 14 app directory route.js testing fails with Vitest wono | discuss | tweet + it dev nextjs mock How do I test routes made with the app router in NextJS? I'm using vitest for this wono | discuss | tweet + it dev nextjs vitest Next.js application testing with Vitest and testing libraryIn this article, weโll continue testing Next.js application using Vitest and testing library, and delve into testing more complex components that interact with APIs, Redux selectors, and customโฆ wono | discuss | tweet + it dev nextjs vitest ํ๋ก ํธ์๋์์ Nextjs์ Vitest๋ฅผ ์ฌ์ฉํด ์์ฝ๊ฒ ํ ์คํ ํ๊ธฐ (๊ทธ๋ฆฌ๊ณ ๊ฐ๋ฐ ์ฌ๋ฐ๊ฒ ํ๊ธฐ)ํ๋ก ํธ์๋ ์ง์์์ ํ ์คํ ์ ํ์๋ก ์ฌ๊ฒจ์ง์ง ์๋ ๊ฒฝ์ฐ๊ฐ ์ ๋ฒ ๋ง์ต๋๋ค. ๊ฐ๊ธฐ ๋ค๋ฅธ ์ด์ ๊ฐ ์๊ฒ ์ง๋ง ์ ๊ฒฝํ์ ์ ๋ โ๋ฐ๋น ์'๊ฐ ์ฃผ๋ ์ด์ ์๋ ๊ฒ ๊ฐ์ต๋๋ค. unit testing, integration testing, e2e testing ๋ชจ๋ 100%์ ์ปค๋ฒ๋ฆฌ์ง๋ก ํ ์คํ ์ ์งํํด์ ๋์ ์ ์ด์ผ ์๊ฒ ๋ค๋ง, ์ฐ๋ฆฌ์ ์ธ๋ถํ๊ฒฝ์ ๊ธฐ๋ค๋ ค ์ค ์ ์์ต๋๋ค. ํนํโฆ wono | discuss | tweet + it dev nextjs jest How to Unit Test Next.js API Routes with TypescriptNext.js is an awesome frontend framework. Itโs powered by React under the hood so it plays well with everything React has to offer out of the box: Hooks, Context, hot browser reloading, Typescriptโฆ wono | discuss | tweet + it dev nextjs jest Mastering Jest: A Complete Guide to Testing Next.js Applications Part-1In the fast-paced world of web development, creating robust and bug-free applications is paramount.... Tagged with jest, testing, nextjs, react. wono | discuss | tweet + it dev nextjs jest Unit Test Next.js API Routes with TypeScript (longer-version)Testing API routes sucks, especially when using TypeScript. This article covers how to unit test Next.js API routes with TypeScript using Jest and React Testing Libraries. With the release of Next.jsโฆ wono | discuss | tweet + it dev jest Jest๋ฅผ ์ด์ฉํด์ ํ ์คํธ ์ฝ๋๋ฅผ ์์ฑํด ๋ณด์!ํ ์คํธ ์ฝ๋๋ฅผ ์์ฑํด์ผํ๋ ์ด์ ...?์์ฑํ ์ฝ๋๊ฐ ์๋ํ ๋๋ก ์๋ํ๋์ง ๊ฒ์ฆํ ์ ์๋ค.์ฝ๋ ๋ณ๊ฒฝ ์, ๋ณ๊ฒฝ ๋ถ๋ถ์ผ๋ก ์ธํ ์ํฅ๋๋ฅผ ์ฝ๊ฒ ํ์ ํ ์ ์๋ค.์ฝ๋ ๋ฆฌํฉํ ๋ง ์ ๊ธฐ๋ฅ ๊ตฌํ์ด ๋์ผํ๊ฒ ๋์๋ค๋ ํ๋จ์ ๋ด๋ฆด ์ ์๋ค.์ฝ๋ ๋ณ๊ฒฝ ์, ๋ณ๊ฒฝ ๋ถ๋ถ์ผ๋ก ์ธํ ์ํฅ๋ wono | discuss | tweet + it dev jest Guide to writing integration tests in express js with Jest and SupertestWriting integration tests for new developers can prove a little tricky. During my first foray into... Tagged with javascript, express, node. wono | discuss | tweet + it dev sveltekit Our design pattern for SvelteKit - how we organize our projects wono | discuss | tweet + it dev sveltekit api SvelteKit API Endpoints And Loading Data For PagesLearn about API endpoints and loading data for your pages with SvelteKit. wono | discuss | tweetNext
+ it dev jest mock [JEST] ๐ ๋ชจํน Mocking ์ ๋ฆฌ - jest.fn / jest.mock /jest.spyOnMocking ์๋ฆฌ mocking์ด๋ (mock = ๋ชจ์กฐํ) ๋ป ๊ทธ๋๋ก ๋ฐ์๋๋ฆฌ๋ฉด ๋๋ค. ์ฆ ํ ์คํธํ๊ณ ์ ํ๋ ์ฝ๋๊ฐ ์์กดํ๋ function์ด๋ class์ ๋ํด ๋ชจ์กฐํ์ ๋ง๋ค์ด '์ผ๋จ' ๋์๊ฐ๊ฒ ํ๋ ๊ฒ์ด๋ค. ํ๋ง๋๋ก, ๋จ์ ํ ์คํธ๋ฅผ ์์ฑํ ๋, ํด๋น ์ฝ๋๊ฐ ์์กดํ๋ ๋ถ๋ถ์ ๊ฐ์ง(mock)๋ก ๋์ฒดํ๋ ๊ธฐ๋ฒ์ ๋งํ๋ค. ์ ๊ฐ์ง๋ก ๋์ฒดํ๋๊ฐ? ํ ์คํธ ํ๊ณ ์ถ์ ๊ธฐ๋ฅ์ด ๋ค๋ฅธ ๊ธฐ๋ฅ๋ค๊ณผ ์ฎ์ฌ์์ ๊ฒฝ์ฐ(์์กด) ์ ํํ ํ ์คํธ๋ฅผ ํ๊ธฐ ํ๋ค๊ธฐ ๋๋ฌธ์ด๋ค. ์๋ฅผ๋ค์ด request body์ ์ฌ์ฉ์์ id์ password๋ฅผ ๋ฃ์ด์ post์์ฒญ์ ๋ณด๋ด๋ฉด ์ปจํธ๋กค๋ฌ์์ ์ ๋ณด๋ฅผ ์ถ์ถํ ํ ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋ฃ์ด์ฃผ๋ ๋จ์ํ ์คํธ๋ฅผ ํ๊ณ ์ถ๋ค๊ณ ํ์. ์ปจํธ๋กค๋ฌ๋ ๋ผ์ฐํฐ์์ ์๋ต์ ๋ณด๋ด๋ ๋ฏธ๋ค์จ์ด๋ฅผ ํน๋ณํ ๋ถ๋ฅด๋ ๋ง์ด๋ค. ๊ทธ๋ฅ ํจ์๋ค. ๋ฐ.. wono | discuss | tweet
+ it dev nextjs jest prisma Next.js, Prisma, Jestใงใตใผใใผใตใคใใฎใในใใใใ wono | discuss | tweet
+ it dev nextjs NextJs best boiler plateBest Boilerplate and Starter for Next.js with App Router support, Tailwind CSS, and TypeScript. โNextJs best boiler plateโ is published by Mahernaija. wono | discuss | tweet
+ it dev vitest prisma Next.js(App Router)ใงไฝใฃใTODOใขใใชใซVitestใงใในใใ่ฟฝๅ ใใพใใ wono | discuss | tweet
+ it dev jest prisma Unit testing with Prisma ORM | Prisma DocumentationLearn how to setup and run unit tests with Prisma Client wono | discuss | tweet
+ it dev vitest Simple Unit Testing with Vitest: NextJS AppUnit testing considers only a unit in an isolated environment whereas there could be a block of code a.k.a function, or component. For better understanding, I will create a simple project toโฆ wono | discuss | tweet
+ it dev vitest How to Mock Fetch API in VitestIn this article, we will learn how to mock the fetch API in Vitest in a to-do list service file. we will use the global along with vi.fn(). wono | discuss | tweet
+ it dev nextjs jest NextJs 14 โ App Router and Unit Testing (w/ async pages)Unit-test in NextJs14 using JEST with practical examples. wono | discuss | tweet
+ it dev nextjs mock How do I test routes made with the app router in NextJS? I'm using vitest for this wono | discuss | tweet
+ it dev nextjs vitest Next.js application testing with Vitest and testing libraryIn this article, weโll continue testing Next.js application using Vitest and testing library, and delve into testing more complex components that interact with APIs, Redux selectors, and customโฆ wono | discuss | tweet
+ it dev nextjs vitest ํ๋ก ํธ์๋์์ Nextjs์ Vitest๋ฅผ ์ฌ์ฉํด ์์ฝ๊ฒ ํ ์คํ ํ๊ธฐ (๊ทธ๋ฆฌ๊ณ ๊ฐ๋ฐ ์ฌ๋ฐ๊ฒ ํ๊ธฐ)ํ๋ก ํธ์๋ ์ง์์์ ํ ์คํ ์ ํ์๋ก ์ฌ๊ฒจ์ง์ง ์๋ ๊ฒฝ์ฐ๊ฐ ์ ๋ฒ ๋ง์ต๋๋ค. ๊ฐ๊ธฐ ๋ค๋ฅธ ์ด์ ๊ฐ ์๊ฒ ์ง๋ง ์ ๊ฒฝํ์ ์ ๋ โ๋ฐ๋น ์'๊ฐ ์ฃผ๋ ์ด์ ์๋ ๊ฒ ๊ฐ์ต๋๋ค. unit testing, integration testing, e2e testing ๋ชจ๋ 100%์ ์ปค๋ฒ๋ฆฌ์ง๋ก ํ ์คํ ์ ์งํํด์ ๋์ ์ ์ด์ผ ์๊ฒ ๋ค๋ง, ์ฐ๋ฆฌ์ ์ธ๋ถํ๊ฒฝ์ ๊ธฐ๋ค๋ ค ์ค ์ ์์ต๋๋ค. ํนํโฆ wono | discuss | tweet
+ it dev nextjs jest How to Unit Test Next.js API Routes with TypescriptNext.js is an awesome frontend framework. Itโs powered by React under the hood so it plays well with everything React has to offer out of the box: Hooks, Context, hot browser reloading, Typescriptโฆ wono | discuss | tweet
+ it dev nextjs jest Mastering Jest: A Complete Guide to Testing Next.js Applications Part-1In the fast-paced world of web development, creating robust and bug-free applications is paramount.... Tagged with jest, testing, nextjs, react. wono | discuss | tweet
+ it dev nextjs jest Unit Test Next.js API Routes with TypeScript (longer-version)Testing API routes sucks, especially when using TypeScript. This article covers how to unit test Next.js API routes with TypeScript using Jest and React Testing Libraries. With the release of Next.jsโฆ wono | discuss | tweet
+ it dev jest Jest๋ฅผ ์ด์ฉํด์ ํ ์คํธ ์ฝ๋๋ฅผ ์์ฑํด ๋ณด์!ํ ์คํธ ์ฝ๋๋ฅผ ์์ฑํด์ผํ๋ ์ด์ ...?์์ฑํ ์ฝ๋๊ฐ ์๋ํ ๋๋ก ์๋ํ๋์ง ๊ฒ์ฆํ ์ ์๋ค.์ฝ๋ ๋ณ๊ฒฝ ์, ๋ณ๊ฒฝ ๋ถ๋ถ์ผ๋ก ์ธํ ์ํฅ๋๋ฅผ ์ฝ๊ฒ ํ์ ํ ์ ์๋ค.์ฝ๋ ๋ฆฌํฉํ ๋ง ์ ๊ธฐ๋ฅ ๊ตฌํ์ด ๋์ผํ๊ฒ ๋์๋ค๋ ํ๋จ์ ๋ด๋ฆด ์ ์๋ค.์ฝ๋ ๋ณ๊ฒฝ ์, ๋ณ๊ฒฝ ๋ถ๋ถ์ผ๋ก ์ธํ ์ํฅ๋ wono | discuss | tweet
+ it dev jest Guide to writing integration tests in express js with Jest and SupertestWriting integration tests for new developers can prove a little tricky. During my first foray into... Tagged with javascript, express, node. wono | discuss | tweet
+ it dev sveltekit Our design pattern for SvelteKit - how we organize our projects wono | discuss | tweet
+ it dev sveltekit api SvelteKit API Endpoints And Loading Data For PagesLearn about API endpoints and loading data for your pages with SvelteKit. wono | discuss | tweet