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

Fix test runner (Mocha) #482

Open
jgaehring opened this issue Jan 14, 2022 · 1 comment
Open

Fix test runner (Mocha) #482

jgaehring opened this issue Jan 14, 2022 · 1 comment

Comments

@jgaehring
Copy link
Member

As I mentioned briefly in #481 (comment), our test framework, Mocha, has been broken for a little while now. This happened possibly as far back as the "monster commit" (59c3f30) that first integrated 2.x changes, or more likely somewhere after alpha.1 but definitely no later than alpha.3 (5f6d629). We only had 2 or 3 unit tests anyways, so this isn't a huge concern, but it would be best to get this back up and running before beta release.

Since I switched over to Vite, I've totally jettisoned the mocha-webpack integration we were using to precompile source prior to testing, so we'll need some kind of alternative to that at the very least. And since we're reevaluating that, and we only have unit tests at the moment, I figure it might be worth considering what test frameworks/runners are available with Vite and Vue 3 going forward. I'll do a link dump at the end of this, but I'll highlight the recommendation from the SFC Tooling section of the Vue 3 docs:

If using Vite, we recommend Cypress as the test runner for both unit and e2e tests. Unit tests for Vue SFCs can be done with the Cypress Component Test Runner.

It looks like Mocha and Jest are still the most prominent choices of framework for Vue 3, so I'd probably elect to keep Mocha rather than use another Facebook product. So I guess then the biggest decision is between Cypress and Puppeteer, with a slight lean towards Cypress w/o having investigated further. Although I suppose just for the unit tests we could also just write a simple node script to precompile everything before testing.

One final consideration is Chromatic, which I had previously set up as our one GitHub action, but I've already removed it on my vite working branch, and I'll want to reevaluate whether to add it back when I consider Storybook in general, which I'll open a separate issue for.

Aforementioned link dump:

@jgaehring
Copy link
Member Author

I have removed these packages from devDependencies in 68f716f as a part of #517:

{
    "@vue/test-utils": "^2.0.0-rc.18",
    "chromatic": "^6.3.4",
    "expect": "^27.4.6",
    "jsdom": "^15.2.1",
    "jsdom-global": "^3.0.2",
    "mocha": "^9.1.3"
}

This is mostly to silence all the upgrade notices for the stale dependencies until I come back to fix this stuff.

jgaehring added a commit to jgaehring/field-kit that referenced this issue Feb 13, 2023
Some of these may need to be reverted for farmOS#482, but will require review.
jgaehring added a commit that referenced this issue Feb 13, 2023
Some of these may need to be reverted for #482, but will require review.
jgaehring added a commit that referenced this issue Feb 24, 2023
Some of these may need to be reverted for #482, but will require review.
jgaehring added a commit to jgaehring/field-kit that referenced this issue Jun 16, 2023
Some of these may need to be reverted for farmOS#482, but will require review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant