Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@vue/cli plugin #26

Open
dnlup opened this issue Mar 21, 2019 · 7 comments
Open

@vue/cli plugin #26

dnlup opened this issue Mar 21, 2019 · 7 comments

Comments

@dnlup
Copy link

dnlup commented Mar 21, 2019

I wrote a plugin to do unit testing for vue. Anyone willing to check it out and give me some feedback? Thanks.

Plugin repo.

@novemberborn
Copy link
Member

Hey @dnlup, I don't know Vue but this looks useful. Happy to link to it here. Perhaps your approach would make a good improvement to our existing Vue recipe? There's also this open issue: avajs/ava#2063

@dnlup
Copy link
Author

dnlup commented Mar 25, 2019

@novemberborn Thank you, If you think this approach could be an improvement I'll be happy to contribute to the recipe, in the meantime I'll try to get some feedback from the issue you posted.

@vinayakkulkarni
Copy link

Vue Recipe & Nuxt Recipe needed for Ava.

@vinayakkulkarni
Copy link

I created a demo app with nuxt & ava with nyc for coverage.

https://github.com/vinayakkulkarni/nuxt-ava-e2e-unit-testing

@dnlup
Copy link
Author

dnlup commented May 28, 2019

@novemberborn After some testing, I changed my approach in the plugin from compiling with webpack to use require extension hooks as shown in the recipes. I had quite some issues gluing webpack and ava (this is not a criticism to either one of the packages, I am sure it is because of something I did wrong) and at the end I was not happy with the result. As soon as I have some time I'll share these issues but in the meantime the recipes work well and I am happy with what is coming out. I am still finishing some last touches then I think I can reach the first stable version.

@vinayakkulkarni
Copy link

@dnlup thoughts on https://github.com/vinayakkulkarni/nuxt-ava-e2e-unit-testing

?

Rather than a package approach.. Why not provide users with a option to use that repo as source of examples for Vue & Ava.

I personally would hate to add another package in my package.json more than ava and Vue for just testing.

@dnlup
Copy link
Author

dnlup commented May 29, 2019

@vinayakkulkarni Your repo is very useful indeed and I can see your point. Examples that the users can tweak to their needs give them a lot of freedom and I agree with that.
This plugin is targeted to users that are using @vue/cli version 3 to scaffold their projects (it exposes a test:unit command for vue-cli-service as the other @vue/cli plugins do and the setup is using @vue/cli specific api), nuxt projects are not covered (because nuxt already has support for ava).

Rather than a package approach.. Why not provide users with a option to use that repo as source of examples for Vue & Ava.

My goal was to make something like @vue/cli-plugin-unit-mocha and @vue/cli-plugin-unit-jest but I like that too, I think could help wtih it.

I personally would hate to add another package in my package.json more than ava and Vue for just testing

I understand. If you are not using @vue/cli version 3 you should not use this but to be fair I am actually injecting the same devDependencies in a project as the one in your repo besides a couple more to load styles too (which I am conflicted about keeping them or not) so there is not much difference here. In general your are actually not just using Vue & Ava but also all the require-extension-hooks packages (injected by the create-nuxt-app when initializing the project in your case), in the plugin I am trying to automate this setup using @vue/cli specific api.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants