Skip to content

feat: unit tests#139

Merged
jessicamcinchak merged 17 commits into
mainfrom
jess/vitest
Aug 12, 2022
Merged

feat: unit tests#139
jessicamcinchak merged 17 commits into
mainfrom
jess/vitest

Conversation

@jessicamcinchak
Copy link
Copy Markdown
Member

@jessicamcinchak jessicamcinchak commented Mar 30, 2022

trying out this stack!
https://vitest.dev/
https://www.npmjs.com/package/happy-dom
https://github.com/vitest-dev/vitest/tree/main/examples/lit

initially tried @open-wc/testing with jest first which spiraled into a lot of tedious configs (ts, jest, babel etc) and wasn't playing so nice with vite, but that then led me to vitest which was very simple to set up (unified config! runs fast!) & has good selection of example repos - including one for Lit - so let's see how it feels!

plus a simple github action to automatically run these tests in PRs against main, starting with this one 🏁
Screenshot from 2022-03-31 17-31-50

closes #52

in the future, maybe we additionally add cyprus for end to end tests, which i think could especially make sense for map interactions? these vitest + cyprus videos (part 1 & 2) seem pretty good, but i haven't watched them through yet

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 30, 2022

Deploy Preview for oslmap ready!

Name Link
🔨 Latest commit 9e571f2
🔍 Latest deploy log https://app.netlify.com/sites/oslmap/deploys/62f662c21cb16d0009a9ebc5
😎 Deploy Preview https://deploy-preview-139--oslmap.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment thread src/components/address-autocomplete/main.test.ts
@jessicamcinchak jessicamcinchak changed the title wip: tests! feat: unit tests Mar 31, 2022
Comment thread src/components/postcode-search/main.test.ts Outdated
Comment thread src/components/postcode-search/main.test.ts
@jessicamcinchak jessicamcinchak requested a review from a team March 31, 2022 15:32
@jessicamcinchak jessicamcinchak marked this pull request as ready for review March 31, 2022 15:32
@jessicamcinchak jessicamcinchak removed the request for review from a team August 3, 2022 14:49
@jessicamcinchak jessicamcinchak marked this pull request as draft August 3, 2022 14:49
Copy link
Copy Markdown
Contributor

@DafyddLlyr DafyddLlyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Embarrassed by how long it's taken me to write this up sorry...! 😬

Stack looks and feels good, tried writing tests and getting to grips with it and I like it. Totally agree with what you're saying about Cypress for maps and interactions - might be worth testing Cypress here and then seeing how we feel with that vs testcafe in PlanX even?

Anyway - solid work, this adds a lot to the repo and is a great foundation 👏

Comment thread src/components/address-autocomplete/main.test.ts
Comment thread src/components/address-autocomplete/main.test.ts
Comment thread src/components/my-map/main.test.ts Outdated
Comment thread src/components/postcode-search/main.test.ts
Comment thread src/components/postcode-search/main.test.ts
Comment thread src/components/postcode-search/main.test.ts Outdated
Comment thread src/test-utils.ts
@jessicamcinchak jessicamcinchak marked this pull request as ready for review August 12, 2022 14:26
@jessicamcinchak jessicamcinchak merged commit 89d4b3d into main Aug 12, 2022
@jessicamcinchak jessicamcinchak deleted the jess/vitest branch August 12, 2022 14:26
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

Successfully merging this pull request may close these issues.

Add tests

2 participants