name()

Returns the name of the Vue Component.

Returns

(String|undefined): Returns the name of the Vue Component.

Example

Example Component

import { mount, mountAsChild } from '@jasoeight/vue-testing';
import { expect } from 'chai';
import Example from './path/to/Example.vue';

describe('Example.vue', () => {
    it('has name "example" (tested with mount())', () => {
        const wrapper = mount(Example);
        expect(wrapper.name()).to.equal('example');
    });

    it('has name "example" (tested with mountAsChild())', () => {
        const wrapper = mountAsChild(Example);
        expect(wrapper.name()).to.equal('example');
    });
});

results matching ""

    No results matching ""