현상

cypress를 도입하면서, jest의 toEqual 프로퍼티를 찾지 못하는 현상이 발생하였습니다.

원인

해결

첫번째 방법 : @jest/globals에서 expect를 import 해오기

import { expect } from '@jest/globals';

두번째 방법 : tsconfig.json에서 cypress.config.ts를 제외 설정해주기

"exclude": [
  "./cypress.config.ts",
  //other exclusions that may help https://github.com/cypress-io/cypress/issues/22059#issuecomment-1428298264
  "node_modules",
  "cypress",
  "**/*.cy.tsx"
]
profile
🧐 사용자와 개발자를 모두 배려하고 싶은 개발자. 백엔드부터 임베디드까지 다양하게 개발하다가 지금은 🎨 프런트엔드에 자리잡았어요.

0개의 댓글

Powered by GraphCDN, the GraphQL CDN