How to Test JSON Schema with AJV in TypeScript

Moon
JavaScript in Plain English
5 min readOct 24, 2019

--

How can you test if your request and response match the interfaces? When I was a beginner to Jest , I only used toMatchSnapshot . With toMatchShot , you can leave the snapshot of data you pass into expect if there is no existing snapshot. If there is, then Jest automatically compares the existing one to the value you passed into expect .

--

--

Frontend React w/ Typescript developer based in S.Korea. Interested in UX/Testing/FE. mgyang95@gmail.com