Comments (3)
That looks really nice! I didn't even think of doing that, because I rarely use events, but this will definitely be useful.
I've invited you to be a collaborator on this repo - thank you for your contributions.
from vue-test.
Thanks for adding me as a collaborator!
I just created PR #8 for this feature. It's pretty straightforward, but after posting above, I got to thinking about whether it's a good idea to keep adding parameters to mount()
.
In PR #7 , I put together an example of an API that takes a hash instead, so usage looks like this:
it('should ...', () => {
const HelloComponent = mount(Hello, {
props: {
prop1: 'foo',
prop2: 7
},
slots: {
slot1: '<div></div>'
},
events: {
event1: someSpyProbably
}
};
});
PR #7 shouldn't be merged as-is, it's for exploring this option.
Some notes:
- This requires Vue 2 (see PR #9)
- Since
mount()
already takes a hash as parm 2, if we name the new APImount
, it would be a breaking change. I think that would be OK if we bump the version up to 2.x
What are your thoughts?
from vue-test.
I like the look of that, wonder if it's possible to make it backwards compatible anyway. Let's discuss it on that PR.
from vue-test.
Related Issues (6)
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 vue-test.