1. vuenit
Vue Unit Test Helpers for server-side testing
vuenit
Package: vuenit
Created by: jackmellis
Last modified: Tue, 28 Jun 2022 20:58:35 GMT
Version: 1.2.0
License: ISC
Downloads: 18
Repository: https://github.com/jackmellis/vuenit

Install

npm install vuenit
yarn add vuenit

vuenit

Vue Unit Test Helpers

npm version
Build Status
Code Climate
Test Coverage

Vuenit is a testing utility that offers a number of useful methods to make testing Vue applications easier:

  • Easily mount Vue components
  • Test directives
  • Search the DOM for component instances
  • Inject dependencies into components
  • Test slots
  • Update data and props on the fly
  • Shallow rendering
  • Mocked versions of Vuex, Vue-Router, and a $http module to make testing with dependencies easier
npm install vuenit --save-dev
 import {mount, mockRouter, mockHttp, mockStore} from 'vuenit';
import c from 'path/to/component';

const {$router} = mockRouter();
const $http = mockHttp();
const $store = mockStore();

const options = {
  inject : { $router, $http, $store },
  props : { userId : 'x4' },
  stubComponents : true
};

const vm = mount(c, options);

Vuenit has a huge array of configuration options for different testing scenarios. For full documentation, see https://jackmellis.gitbooks.io/vuenit/content

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code