Comments (6)
I'm happy to take a stab at the setup/environment/configuration part of the docs
from test-utils.
Contrary to belief, I have gotten many questions, probably you as well, on how to setup VTU with Jest/Mocha/SomethingNoOneEverUsed.js even with the old docs having sections for that.
I dont think this will change. I would not go into setting up my own webpack setup, but then again people use Rollup or Parcel, so rough guidelines are necessary I think.
from test-utils.
yeah, as long as we explain why those are needed in a few words, thats more than enough :) We will always have to reply to such questions hehe
from test-utils.
I added something very minimal here for the first two steps https://github.com/vuejs/vue-test-utils-next-docs/blob/master/src/guide/installation.md
It is not polished at all but it's enough to get started with VTU next. The first line is a lie - vtu next is not on NPM yet, was just getting ready.
We should probably work with sodatea to get a vue-cli plugin with vue-jest next (aka vue-jest 5) and vtu next.
from test-utils.
Hm, Vue itself does not provide docs on how to configure webpack/parcel/vue-loader.
We could provide something generic (since these kind of specific guides tend to get out of date first). The ideas are the same for all runners. So something along the lines of:
- VTU requires a DOM environment to run. Most commonly used it jsdom.
document
must be globally available before using VTU. - Your test runner needs to understand vue files. Jest uses
vue-jest
, and webpack-based runners (mocha-webpack) can usevue-loader
. - Here is a basic template using Jest and Webpack
Low on implementation details, just a few sentences explaining the basic and a link or two to some working templates so people can get going asap.
I have a basic template here we could clean up and use.
Also we should work on a cli-plugin.
from test-utils.
Sure! Thanks.
from test-utils.
Related Issues (20)
- Feature request: update teleport testing documentation HOT 1
- Bug: snapshots are mismatching on different platforms HOT 8
- Bug: wrapper.findComponent no longer working after upgrading to 2.4.2 HOT 6
- Bug: clicking button type submit doesn't trigger submit event HOT 2
- Bug: can't pass a prop to a stubbed custom element using a `.prop` modifier HOT 1
- chore(docs): translate the documentation to portuguese
- Bug: TypeError: $setup.mergeProps is not a function HOT 5
- Feature request: mount should accept a partial that describes local properties on component HOT 1
- Bug: Circular references in props cause "Maximum call stack size exceeded" since v2.4.5 HOT 7
- Bug: findComponent doesn't find anything when using @vue/compat HOT 4
- DOMWrapper giving different return than createWrapper. HOT 6
- .setValue to work on `[contenteditable=true]` elements HOT 2
- Bug: "to" is missing from the attribute in RouterLinkStub HOT 1
- Bug: isDeepRef causes "RangeError: Maximum call stack size exceeded" HOT 1
- Bug: Scoped slots always undefined when shallow mounting and `renderStubDefaultSlot` is enabled HOT 1
- Docs: afterEach in teleport section causes issues on happy-dom HOT 1
- dev: use eslint v9
- Bug: Event declared via $attrs in mount not establishing prop prefixed with `on` HOT 3
- Using useSlots will report a warning HOT 1
- Bug: Stubs broken in `[email protected]` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from test-utils.