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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add basic configuration #299

Closed
afontcu opened this issue Apr 8, 2020 · 6 comments
Closed

docs: Add basic configuration #299

afontcu opened this issue Apr 8, 2020 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@afontcu
Copy link
Member

afontcu commented Apr 8, 2020

VTU should be quite plug-and-play as long as you install it in a Vue project (what other projects would want to use VTU? 馃).

Thus, this section should be really thin so people can start to write tests as soon as possible.

Thoughts:

  • provide basic steps for Vue 3 + VTU + Jest
  • provide a demo repo with config
  • point to @vue/cli and its VTU plugin (should we discuss this?)
  • provide config for common scenarios (asset stubbing, for instance?)
@lmiller1990
Copy link
Member

lmiller1990 commented Apr 9, 2020

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.

@dobromir-hristov
Copy link
Contributor

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.

@lmiller1990
Copy link
Member

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 use vue-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.

@dobromir-hristov
Copy link
Contributor

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

@JessicaSachs
Copy link
Contributor

I'm happy to take a stab at the setup/environment/configuration part of the docs

@JessicaSachs JessicaSachs self-assigned this May 24, 2020
@lmiller1990
Copy link
Member

Sure! Thanks.

@afontcu afontcu transferred this issue from vuejs/test-utils-docs Jan 25, 2021
@afontcu afontcu changed the title feat: Add basic configuration docs: Add basic configuration Jan 25, 2021
@afontcu afontcu added the documentation Improvements or additions to documentation label Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants