awesome-ava icon indicating copy to clipboard operation
awesome-ava copied to clipboard

@vue/cli plugin

Open dnlup opened this issue 6 years ago • 7 comments

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

Plugin repo.

dnlup avatar Mar 21 '19 14:03 dnlup

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: https://github.com/avajs/ava/issues/2063

novemberborn avatar Mar 24 '19 14:03 novemberborn

@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.

dnlup avatar Mar 25 '19 11:03 dnlup

Vue Recipe & Nuxt Recipe needed for Ava.

vinayakkulkarni avatar Apr 13 '19 10:04 vinayakkulkarni

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

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

vinayakkulkarni avatar Apr 13 '19 17:04 vinayakkulkarni

@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.

dnlup avatar May 28 '19 18:05 dnlup

@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.

vinayakkulkarni avatar May 29 '19 03:05 vinayakkulkarni

@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.

dnlup avatar May 29 '19 08:05 dnlup