testing library

    TIL | Testing Library Queries

    Testing Library Queries Queries Testing Library 에서의 쿼리는, 페이지에서 요소들을 찾기위해 필요한 메서드이다. 쿼리는 get,find,query 3가지 타입이 존재하며, 그 차이점은 찾고자 하는 요소가 없을때 에러를 발생시키는지, 혹은 프로미스를 반환하고 다시 실행하는 여부에 차이가 있다. 선택하고자 하는 페이지의 컨텐츠에 따라 쿼리들이 적절하게 사용어야 하므로, priority guid를 참고하여 사용하고자 하는 쿼리를 지정하자. Type of Query 0 Matches 1 Match > 1 Matches Retry(Async/Await) Single Element getBy... Throw error Return element Throw error No que..

    TIL | testing-library, Jest-Dom eslint 설정하기

    Testing Library, Jest-DOM eslint 설정하기 plugin 설치 yarn add -D eslint-plugin-jest-dom eslint-plugin-testing-library eslint-plugin-jest-dom: jest-dom 체크를 위한 eslint 플러그인 eslint-plugin-testing-library: testing-library 체크를 위한 eslint 플러그인 package.json "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, 기존 package.json의 eslintConfig 부분 지워주기 eslintrc.json { "extends": [ "react-app", "react-a..