getPropertyKeys()

Returns a list with all property keys.

Returns

(Array): All property keys.

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 properties "firstname" & "lastname" (tested with mount())', () => {
        const wrapper = mount(Example);
        expect(wrapper.getPropertyKeys()).to.eql(['firstname', 'lastname']);
    });

    it('has properties "firstname" & "lastname" (tested with mountAsChild())', () => {
        const wrapper = mountAsChild(Example);
        expect(wrapper.getPropertyKeys()).to.eql(['firstname', 'lastname']);
    });
});

results matching ""

    No results matching ""