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

vue-test-utils

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-test-utils - npm Package Compare versions

Comparing version 0.5.0 to 1.0.0-beta

dist/vue-test-utils.amd.js

111

package.json
{
"name": "vue-test-utils",
"version": "0.5.0",
"description": "jQuery-like DOM query and event trigger.",
"main": "index.js",
"version": "1.0.0-beta",
"description": "Utilities for testing Vue components.",
"main": "dist/vue-test-utils.js",
"types": "types/index.d.ts",
"files": [
"dist/*.js",
"types/index.d.ts"
],
"scripts": {
"test": "jest --no-cache",
"watch": "jest --no-cache --watch"
"build": "node build/build.js",
"docs": "cd docs && gitbook install && gitbook serve",
"docs:deploy": "build/update-docs.sh",
"flow": "flow check",
"lint": "eslint --ext js,vue src test flow build --ignore-path .gitignore",
"lint:docs": "eslint --ext js,vue,md docs --ignore-path .gitignore",
"lint:fix": "npm run lint -- --fix",
"setup": "node build/install-hooks.js",
"test": "npm run lint && npm run lint:docs && npm run flow && npm run test:types && npm run test:unit && npm run test:unit:karma",
"test:compatibility": "test/test.sh",
"test:unit": "mocha-webpack --webpack-config build/webpack.test.config.js test/unit/specs --recursive --require test/unit/setup/mocha.setup.js",
"test:unit:karma": "cross-env BABEL_ENV=test TARGET=browser karma start test/unit/setup/karma.conf.js --single-run",
"test:types": "tsc -p types",
"release": "bash build/release.sh",
"release:note": "node build/gen-release-note.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/holmescn/vue-test-utils.git"
"url": "git+https://github.com/vuejs/vue-test-utils.git"
},
"keywords": [
"vue",
"test",
"jquery"
],
"author": {
"name": "Holmes Conan",
"email": "holmesconan@gmail.com"
},
"author": "vuejs",
"license": "MIT",
"bugs": {
"url": "https://github.com/holmescn/vue-test-utils/issues"
"url": "https://github.com/vuejs/vue-test-utils/issues"
},
"homepage": "https://github.com/holmescn/vue-test-utils#readme",
"jest": {
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/vue"
]
"homepage": "https://github.com/vuejs/vue-test-utils#readme",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-eslint": "^7.2.3",
"babel-loader": "^7.0.0",
"babel-plugin-istanbul": "^4.1.4",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-flow-vue": "^1.0.0",
"babel-preset-stage-2": "^6.24.1",
"chai": "^4.0.0",
"chalk": "^2.1.0",
"conventional-changelog": "^1.1.3",
"cross-env": "^5.0.0",
"css-loader": "^0.28.4",
"eslint": "^4.5.0",
"eslint-plugin-flowtype": "^2.34.0",
"eslint-plugin-html": "^3.2.0",
"eslint-plugin-markdown": "^1.0.0-beta.6",
"eslint-plugin-vue": "^2.0.1",
"eslint-plugin-vue-libs": "1.2.0",
"flow-bin": "^0.47.0",
"gitbook-cli": "^2.3.0",
"jsdom": "^11.0.0",
"jsdom-global": "^3.0.2",
"karma": "^1.7.0",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
"karma-mocha": "^1.3.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-phantomjs-shim": "^1.4.0",
"karma-sinon-chai": "^1.3.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "^0.0.31",
"karma-webpack": "^2.0.3",
"mocha": "^3.5.0",
"mocha-webpack": "^1.0.0-rc.1",
"rollup": "^0.43.0",
"rollup-plugin-buble": "^0.15.0",
"rollup-plugin-commonjs": "^8.2.0",
"rollup-plugin-flow-no-whitespace": "^1.0.0",
"rollup-plugin-node-resolve": "^3.0.0",
"shelljs": "^0.7.8",
"sinon": "^2.3.2",
"sinon-chai": "^2.10.0",
"typescript": "^2.4.1",
"vue": "^2.4.4",
"vue-loader": "^13.0.5",
"vue-router": "^2.7.0",
"vue-template-compiler": "^2.4.4",
"vuex": "^2.4.1",
"webpack": "^3.6.0",
"webpack-node-externals": "^1.6.0"
},
"devDependencies": {
"babel-jest": "^12.0.2",
"babel-preset-es2015": "^6.6.0",
"jest-cli": "^12.0.2",
"vue": "^1.0.21"
"peerDependencies": {
"vue": "2.x",
"vue-template-compiler": "^2.x"
},
"dependencies": {
"lodash": "^4.17.4"
}
}
# 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.
## Currently not published on npm
To use vue-test-utils pre-release:
```
npm install --save-dev https://github.com/vuejs/vue-test-utils/
```
This utils currently only provided three functions to help you test your program.
## Intro
## 1. $ function
`vue-test-utils` is the official test library for [Vue.js](http://vuejs.org). It provides methods for unit testing Vue components.
Just like the `$` funciton in jQuery, except that it is bound to the `Rel` element.
Then you can do this:
## Documentation
const vm = new Vue(...);
vm.$('some-element');
Refer to [documentation](https://vuejs.github.io/vue-test-utils/)
## 2. $$ function
## Examples
The `$` function is just a proxy to `querySelector`, but this function is proxied
to `querySelectorAll`, so it returns a `NodeList`.
- [example with Jest](https://github.com/eddyerburgh/vue-test-utils-jest-example)
- [example with Mocha](https://github.com/eddyerburgh/vue-test-utils-mocha-example)
- [example with tape](https://github.com/eddyerburgh/vue-test-utils-tape-example)
- [example with AVA](https://github.com/eddyerburgh/vue-test-utils-ava-example)
## 3. $fire function
## Questions
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:
For questions and support please use the [Discord chat room](https://vue-land.js.org/), [Gitter chat room](https://gitter.im/vuejs/vue), or [the official forum](http://forum.vuejs.org). The issue list of this repo is **exclusively** for bug reports and feature requests.
const vm = new Vue(...);
vm.$fire('some-element', 'click');
// or with event options
vm $fire('some-element', 'click', { ctrlKey: true });
## Issues
Although they are just simple proxy functions that are easy to create, they extremely
improved your productivity, trust me ^_^.
Please make sure to read the [Issue Reporting Checklist](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md#issue-reporting-guidelines) before opening an issue. Issues not conforming to the guidelines may be closed immediately.
## Contribution
Please make sure to read the [Contributing Guide](https://github.com/vuejs/vue/blob/dev/.github/CONTRIBUTING.md) before making a pull request. If you have a Vue-related project/component/tool, add it with a pull-request to [this curated list](https://github.com/vuejs/awesome-vue)!
## Changelog
Details changes for each release are documented in the [release notes](https://github.com/vuejs/vue-test-utils/releases).
## Stay In Touch
For the latest releases and announcements, follow on Twitter: [@vuejs](https://twitter.com/vuejs)
## License
[MIT](http://opensource.org/licenses/MIT)

Sorry, the diff of this file is not supported yet

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