# ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” API ๋ชฉ๋ก

๋‹จ์œ„ ํ…Œ์ŠคํŠธ ์ผ€์ด์Šค ์ž‘์„ฑ์„ ์œ„ํ•ด ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” API ๋ชฉ๋ก์ž…๋‹ˆ๋‹ค.

# Shallow Rendering

ํ…Œ์ŠคํŠธ ํ•  ์ปดํฌ๋„ŒํŠธ์˜ ๊ธฐ๋Šฅ๋งŒ ํ…Œ์ŠคํŠธํ•˜๊ณ  ํ•˜์œ„ ์ปดํฌ๋„ŒํŠธ์™€๋Š” ๋ถ„๋ฆฌํ•ด์ฃผ๋Š” ํ…Œ์ŠคํŠธ API

import { shallowMount } from '@vue/test-utils'
import Component from './component'

describe('Component', () => {
  test('is a Vue instance', () => {
    const wrapper = shallowMount(Component);
    expect(wrapper.isVueInstance()).toBeTruthy();
  })
})

mount a component without rendering its child components

# Mount

ํ…Œ์ŠคํŠธํ•  ์ปดํฌ๋„ŒํŠธ์˜ ํ•˜์œ„ ์ปดํฌ๋„ŒํŠธ์˜ ๋™์ž‘๊นŒ์ง€ ํ•จ๊ป˜ ํ…Œ์ŠคํŠธ ํ•˜๋Š” API

// helloworld.test.js
import { mount } from '@vue/test-utils';
import HelloWorld from './HelloWorld.vue';

test('HelloWorld Component', () => {
  const wrapper = mount(HelloWorld);
  expect(wrapper.vm.message).toBe('Vue!');
});