Tresjs / tres

Declarative ThreeJS using Vue Components
https://tresjs.org
MIT License
2.17k stars 102 forks source link

chore(vitest): add vitest 2 browser beta test #715

Open userquin opened 4 months ago

userquin commented 4 months ago

This is just a test using Vitest beta v2.0 packages to run the new added test in the browser: src/components/TresCanvas.test.ts cloned from my previous branch (https://github.com/Tresjs/tres/blob/userquin/feat-vitest-browser/src/components/TresCanvas.test.ts).

To run the browser test:

We can also use webdriverio or playwright, you need to add the corresponding dependencies as dev dependencies and run:

This PR using vitest packages from local tgz from this PR: https://github.com/vitest-dev/vitest/pull/5815

✔️ DONE: Once we released a new beta version we can use vitest from npm registry.

For CI, we need to include webdriverio or playwright and configure headless to true.

netlify[bot] commented 4 months ago

Deploy Preview for tresjs-docs ready!

Name Link
Latest commit a6d7fe7d96b4ad63d50e0b64975d51c4870d6ccf
Latest deploy log https://app.netlify.com/sites/tresjs-docs/deploys/665e335f6f19cc0008e33f65
Deploy Preview https://deploy-preview-715--tresjs-docs.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 configuration.

userquin commented 4 months ago

Once the browser finish running the tests, run the TresCanvas test to see the UI:

imagen

andretchen0 commented 4 months ago

e2e tests would be a big help. Looking forward to this.

userquin commented 4 months ago

@andretchen0 we need to cover e2e tests, we have some internal team discussion about it, stay tuned

userquin commented 4 months ago

Here a repository with advanced manual and on demand examples in the playground: https://github.com/userquin/tresjs-vitest-browser-tests

Can also run in StackBlitz, link in the readme file.