BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
22.78k stars 3.39k forks source link

Add vscode launch config for "Run and Debug current unit test file (Dev)", and add "Jest Runner" to recommended VSCode extension list #15121

Closed AmoebaChant closed 1 month ago

AmoebaChant commented 1 month ago

This VSCode launch config will build then run just the unit test file current selected in VSCode, making it easier to iterate quickly on a single unit test file.

bjsplat commented 1 month ago

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat commented 1 month ago

Snapshot stored with reference name: refs/pull/15121/merge

Test environment: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15121/merge/index.html

To test a playground add it to the URL, for example:

https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15121/merge/index.html#WGZLGJ#4600

Links to test babylon tools with this snapshot:

https://playground.babylonjs.com/?snapshot=refs/pull/15121/merge https://sandbox.babylonjs.com/?snapshot=refs/pull/15121/merge https://gui.babylonjs.com/?snapshot=refs/pull/15121/merge https://nme.babylonjs.com/?snapshot=refs/pull/15121/merge

To test the snapshot in the playground with a playground ID add it after the snapshot query string:

https://playground.babylonjs.com/?snapshot=refs/pull/15121/merge#BCU1XR#0

bjsplat commented 1 month ago

WebGL2 visualization test reporter:

https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15121/merge/testResults/webgl2playwright/index.html

bjsplat commented 1 month ago

Visualization tests for WebGPU (Experimental) Important - these might fail sporadically. This is an optional test.

https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15121/merge/testResults/webgpuplaywright/index.html

ryantrem commented 1 month ago

I use the Jest Runner VSCode extension, which lets you run or debug individual suites or tests. It's the only Jest test runner VSCode extension that has worked reliably for me across many different repos. This is what it looks like in VSCode (see the Run|Debug CodeLens annotations by the red lines I drew next to them): image If no one has a strong preference for a different extension, maybe we should add this one (firsttris.vscode-jest-runner) to extensions.json?

sebavan commented 1 month ago

Let s check both with Raanan tomorrow :-) honestly no prefs but love that we make testing/debugging tests easier

RaananW commented 1 month ago

I love both methods. I personally use command line to run tests, but would be great to support all methods, as long a they don't collide. Let's add the extension to the recommended extensions as it can be very helpful, and get this also merged as well, so people can still select a file to test without installing the extension