๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Vue.js

[Vue] axios ์š”์ฒญ ํ•จ์ˆ˜๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ์ปดํฌ๋„ŒํŠธ ํ…Œ์ŠคํŠธ

by devebucks 2022. 9. 2.
728x90

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

/**
 * @jest-environment jsdom
 */
import { shallowMount } from "@vue/test-utils";
import ClassDetailModal from "./ClassDetailModal.vue";
jest.mock("@/src/axios/api/class"); ๐Ÿ‘ˆ api ์š”์ฒญ ํ•จ์ˆ˜ ํŒŒ์ผ ์ž์ฒด๋ฅผ ๋ชฉํ‚นํ•จ.

test('', async () => {
  ๋ฐ์ดํ„ฐ ๋ณ€๊ฒฝ
  await wrapper.vm.$nextTick(); ๐Ÿ‘ˆ ๋น„๋™๊ธฐ
  ๋ณ€๊ฒฝ๋œ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ฐ˜์˜๋œ UI ํ™•์ธ
})

 

 

์ฐธ๊ณ 

https://www.daleseo.com/jest-mock-modules/

728x90

๋Œ“๊ธ€