inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

173만명의 커뮤니티!! 함께 토론해봐요.

테스트 실행하면 fail이 나오는데 어떻게 해결해야될까요?

미해결

따라하며 배우는 도커와 CI환경 [2023.11 업데이트]

아래 다른분이 질문하셨길래 봤는데 어디를 지워야할지 모르겠습니다 아래는 실행했을때 에러코드입니다 FAIL src/App.test.js ✕ renders learn react link (78 ms) ● renders learn react link TestingLibraryElementError: Unable to find an element with the text: /learn react/i. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. <body> <div> <div class="App" > <header class="App-header" > <img alt="logo" class="App-logo" src="logo.svg" /> <p> Edit <code> src/App.js </code> and save to reload. </p> <a class="App-link" href="https://reactjs.org" rel="noopener noreferrer" target="_blank" > 안녕안녕 </a> </header> </div> </div> </body> 4 | test('renders learn react link', () => { 5 | render(<App />); > 6 | const linkElement = screen.getByText(/learn react/i); | ^ 7 | expect(linkElement).toBeInTheDocument(); 8 | }); 9 | at Object.getElementError (node_modules/@testing-library/dom/dist/config.js:37:19) at node_modules/@testing-library/dom/dist/query-helpers.js:90:38 at node_modules/@testing-library/dom/dist/query-helpers.js:62:17 at getByText (node_modules/@testing-library/dom/dist/query-helpers.js:111:19) at Object.<anonymous> (src/App.test.js:6:30) Test Suites: 1 failed, 1 total Tests: 1 failed, 1 total Snapshots: 0 total Time: 4.242 s Ran all test suites. Watch Usage &rsaquo; Press f to run only failed tests. &rsaquo; Press o to only run tests related to changed files. &rsaquo; Press q to quit watch mode. &rsaquo; Press p to filter by a filename regex pattern. &rsaquo; Press t to filter by a test name regex pattern. &rsaquo; Press Enter to trigger a test run.

  • 리액트앱
  • 도커
  • github
  • aws
  • 리액트앱테스트
  • docker
  • 데이터 엔지니어링
  • cicd
  • travis-ci
댓글 1 좋아요 0 조회수 797

인기 태그

인프런 TOP Writers

주간 인기글