Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-test-utils

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-test-utils

jQuery-like DOM query and event trigger.

  • 0.5.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6K
decreased by-28.07%
Maintainers
1
Weekly downloads
 
Created
Source

vue-test-utils

When test Vue.js project, you probably need some kind of thing to check the DOM, or trigger events to check if the component work correctly. Of course, jQuery is your friend, but it add so many feature that you do not need.

This utils currently only provided three functions to help you test your program.

1. $ function

Just like the $ funciton in jQuery, except that it is bound to the Rel element. Then you can do this:

const vm = new Vue(...);
	vm.$('some-element');

2. $$ function

The $ function is just a proxy to querySelector, but this function is proxied to querySelectorAll, so it returns a NodeList.

3. $fire function

This combines the $ function with a simple event trigger which is brought from the elegant, small but power full JS library: blissfuljs. Then you can:

const vm = new Vue(...);
	vm.$fire('some-element', 'click');
	// or with event options
	vm $fire('some-element', 'click', { ctrlKey: true });

Although they are just simple proxy functions that are easy to create, they extremely improved your productivity, trust me ^_^.

Keywords

FAQs

Package last updated on 07 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc