profile
Why?에서 시작해 How를 찾는 과정을 좋아합니다. 그 고민과 성장의 과정을 꾸준히 기록하고자 합니다.
태그 목록
전체보기 (465)error(9)알고리즘(8)git(7)DFS(7)Two pointers(7)Algorythm(7)js(6)BFS(5)React(5)redux(5)webpack(5)leetcode(4)breadth first search(4)리액트(4)ts(4)test(4)offsetX(3)keydown(3)TIL(3)JS30(3)Binary Search(3)bindActionCreators(3)recursion(3)State(3)transform(3)rotate(3)DP(3)백준(3)shallow copy(3)depth first search(3)Recoil(2)unit test(2)ghost defense(2)indexOf(2)절대경로(2)next.js(2)tsconfig(2)linked list(2)stack(2)modal(2)Next.js 13(2)Array.from(2)async(2)innerHeight(2)scrollY(2)scroll(2)login(2)Map(2)mapstatetoprops(2)vanilla js(2)hash set(2)프로그래머스(2)reduce(2)입출력과사칙연산(2)refactoring(2)Constructor(2)자바스크립트(2)mapdispatchtoprops(2)algo(2)컴포넌트(2)Prototype(2)connect()(2)Suspense(2)transitionend(2)currentTime(2)transform-origin(2)convention(2)fromIndex(2)jest(2)Node(2)repository(2)path parameter(2)router(2)dynamic programming(2)pageX(2)type(2)프로토타입(2)slice(2)offsetWidth(2)getBoundingClientRect(2)semantic(2)Sliding Window(2)Bit manipulation(2)얕은복사(2)offsetTop(2)asynchronous(1)event loop(1)shift(1)while(1)for(1)import(1)absolutepath(1)concat(1)가운데정렬(1)reference(1)find(1)(1)클래스(1)semantic tag(1)findIndex(1)환경변수(1)(1)merge(1)rebase(1)dotenv(1)hash(1)Flexbox(1)callback(1)예외처리(1)행렬(1)코드스플리팅(1)naming convention(1)node.js(1)in(1)iteration(1)local storage(1)drag(1)capturing(1)yield(1)bubbling(1)fork(1)revert(1)semantic web(1)for...in(1)원시값(1)for...of(1)pathname(1)social-login(1)InnerHTML(1)깊은복사(1)createAction(1)keyCode(1)함수선언(1)textContent(1)setAttribute(1)DevTool(1)static method(1)super(1)Sort(1)재귀(1)pagination(1)해시(1)(1)TWIL(1)atom(1)CS(1)filter(1)formData(1)base64(1)line height(1)매개변수(1)LIMIT(1)data binding(1)commit(1)Context API(1)keyup(1)정규표현식(1)싱글턴 패턴(1)once(1)REST(1)switch(1)arguments(1)Singleton(1)Absolute Path(1)DROP(1)토큰(1)execution context(1)MVC(1)Center(1)mock(1)translate(1)OAuth2.0(1)origin(1)hasOwnProperty(1)Rollup(1)env(1)icon(1)build(1)selector(1)소수찾기(1)challenge(1)routing(1)복사(1)race condition(1)sop(1)bundler(1)연결리스트(1).env(1)생성자함수(1)tofixed(1)인터넷(1)parsing(1)SDK(1)실행컨텍스트(1)라우팅(1)provider(1)dependency(1)object.entries(1)object.values(1)object.keys(1)RenderTree(1)ScrollIntoView(1)CSSOM(1)소셜 로그인(1)시멘틱(1)duration(1)SOME(1)code_splitting(1)unit(1)Routes(1)stopPropagation(1)git log(1)git revert(1)성능개선(1)innerText(1)setProperty()(1)유사배열객체(1)Sementic web(1)dynamic programing(1)nodeList(1)clientHeight(1)offsetHeight(1)mouseenter(1)mouseleave(1)screenX(1)every(1)ListNode(1)query parameter(1)HTMLCollection(1)module format(1)entries(1)FileReader(1)바닐라 자바스크립트(1)react-modal(1)shiftKey(1)동적 라우팅(1)scrollLeft(1)playbackRate(1)esbuild(1)useParams(1)coordinates(1)약수(1)useLocation(1)localeCompare(1)pick(1)blur(1)path variable(1)참조값(1)NFT(1)@compound component(1)charCodeAt(1)cubic-bezier(1)data-*(1)정적 메서드(1)vite(1)React18(1)Web3(1)교육과정(1)KeyboardEvent(1)pointer-events(1)짝수(1)중복값제거(1)METAMASK(1)forinloop(1)again(1)원티드 프리온보딩 프론트엔드(1)timeupdate(1)clientX(1)preonboarding(1)원티드 프리온보딩(1)react-icon(1)state 끌어올리기(1)콜라츠(1)functionComponent(1)headless(1)useSetRecoilState(1)useRecoilState(1)useRecoilValue(1)transform:rotate(1)transition-timing-function(1)margin:auto(1)text-align:center(1)input event(1)input: range(1)input: color(1)배열 안 모든 요소 인덱스 찾기(1)배열 요소의 모든 위치 찾기(1)array replace(1)innderHeight(1)evendigits(1)screenHeight(1)끝까지 스크롤했는지 판별(1)premitive(1)outerHeight(1)얕은복사 전개연산자(1)textShadow(1)KeyboardEvent.shiftkey(1)cornify_add()(1)event.preventDefault()(1)event.isComposing()(1)git push -f origin(1)mouseenter event(1)offsetLeft(1)leeetCode(1)hamming weight(1)Depth-first searach(1)paddingTop(1)redux-devtools-extension(1)handleActions(1)headless ui(1)댓글삭제(1)댓글추가(1)교육과정 설계(1)과반수(1)npm error(1)rm --cached(1)legacy-peer-deps(1)reword(1)serializes(1)toEqual(1)toBe(1)return-type(1)ts error(1)next error(1)니콘내콘(1)기프티콘 앱(1)숙박플랫폼(1)스테이메모리(1)testingLibraryElementError(1)E2ETest(1)unhandledPromiseRejection(1)sytaxError(1)moduleFormat(1)--legacy-peer-deps(1)cryptowallet(1)googleid(1)재사용성(1)Maximum call stack size exceeded(1)radix-ui(1)좋은 컴포넌트(1)offset(1)streaming SSR(1)serialize(1)테스트코드(1)--force(1)dynamic routing(1)eth(1)라우터(1)fallback(1)deep copy(1)CSS(1)squash(1)classList(1)flatmap(1)event delegation(1)lazy(1)유닛테스트(1)IntersectionObserver(1)bundle(1)소셜로그인(1)온보딩(1)promise(1)CRA(1)테스트(1)context(1)aws(1)cors(1)express(1)ESLint(1)blockchain(1)immutability(1)display(1)&&(1)비트연산(1)클로저(1)array(1)spread operator(1)github(1)reset(1)http(1)REST API(1)JWT(1)카카오(1)Module(1)npm(1)API(1)class(1)소수(1)자료구조(1)rendering(1)Flux(1)Database(1)프로젝트(1)디자인 패턴(1)oAuth(1)평균(1)cypress(1)DOM(1)nextjs(1)SSR(1)position(1)await(1)iterable(1)iterator(1)git reset(1)Design Pattern(1)queue(1)this(1)arrayLike(1)path(1)closure(1)Object.assign(1)인가(1)인증(1)배열(1)next(1)JSX(1)useEffect(1)S3(1)유닛 테스트(1)regex(1)URI(1)query(1)cloudfront(1)transition(1)video(1)
post-thumbnail

[Jest] mock 함수 정리

테스트 코드를 작성하면서 mock 함수에 대해 알게 되었는데, 뭐가 다른건지 왜 사용하는지 어떻게 사용하는 건지 헷갈리고 알기 어려워서, 하나하나 사용법을 정리해보았다. Mocking 단위 테스트를 작성할 때 해당 코드가 의존하는 부분을 가짜로 대체하는 기법. 일반적으로 테스트하려는 코드가 의존하는 부분을 직접 생성하기 부담스러울 경우 많이 사용한다. 실제 객체를 사용하는 것보다 훨씬 가볍고 빠르게 실행되면서도, 항상 동일한 결과를 내는 테스트를 작성할 수 있다. jest.fn() Jest에서는 가짜함수 즉 Mock function을 생성할 수 있도록 jest.fn()메서드를 제공한다. 이 함수는 일반 자바스크립트 함수와 동일하게 인자를 전달해 호출할 수 있다. 함께 사용할 수 있는 메서드들도 보자. mockReturnValue mock 함수가 어떤 값을 리턴해야 할지 설정해줄 수 있다. mockResolvedValue `mo

2022년 3월 22일
·
0개의 댓글
·
post-thumbnail

[Test][error]serializes to the same string

Unit Test를 진행하던 중 오류가 발생했다. 이 상태로 테스트를 진행했더니, serializes to the same string이라는 에러가 떴다. 무슨 말일까? Jest 공식 깃허브의 issue 탭을 확인해보았다. 그 중 한 답변을 참고했다. >toBe does physical comparison (referential identity, ie. that they are the same, not just look the same) on comp

2022년 1월 26일
·
0개의 댓글
·