@belsrc/vue-test-functional-wrapper

1.0.1 • Public • Published

vue-test-functional-wrapper

Build Status Maintainability Code Coverage Known Vulnerabilities Last Commit PRs Welcome

Install

npm i -D @belsrc/vue-test-functional-wrapper

Use

// functional-component.test.js
import wrapFunctional from '@belsrc/vue-test-functional-wrapper';
import FunctionalComponent from './functional-component';

let wrapped;

describe('FunctionalComponent', () => {
  beforeEach(() => {
    wrapped = wrapFunctional(FunctionalComponent, {
      methods: { click() { this.$emit('click'); } },
      on(vm) { return { click: vm.click } },
    });
  });

  describe('Rendering', () => {
    test('should do somthing', () => {
      const wrapper = mount(wrapped, {
        propsData: { foo: 'bar' },
      });

      ...
    });
  });
});

LICENCE

MIT

Package Sidebar

Install

npm i @belsrc/vue-test-functional-wrapper

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

5.69 kB

Total Files

4

Last publish

Collaborators

  • belsrc