jsdom-astro-svelte Svelte Themes

Jsdom Astro Svelte

Client testing of Astrojs with Svelte island

jsdom-astro-svelte

Client testing of Astrojs with Svelte island

Install

Deno

curl -fsSL https://deno.land/install.sh | sh (more installation options)

Clone repo

git clone [email protected]:ambrt/jsdom-astro-svelte.git
cd jsdom-astro-svelte
npm i 

Run test

npm run test:deno

Result

Results should show content similar to:

Download http://localhost:4321/node_modules/.vite/deps/chunk-L3IDHH4W.js?v=a19ae93c
Download http://localhost:4321/node_modules/.vite/deps/@astrojs_svelte_client__js.js?v=a19ae93c
stdout | test/deno.test.ts > JSDOM > JSDOM with resources
[vite] connecting...

stdout | test/deno.test.ts > JSDOM > JSDOM with resources
after wait
Test: Clicks: 0 OnMount: yes Click Button

stdout | test/deno.test.ts > JSDOM > JSDOM with resources
[vite] connected.

stdout | test/deno.test.ts > JSDOM > JSDOM with resources
Test: Clicks: 1 OnMount: yes Click Button
28.79393600000003

Output Test: Clicks: 1 OnMount: yes means that
there was 1 click and OnMount:yes that onMount() was called and updated the DOM

Notes

  • Test runs dev server on hard coded 4321 port so it should be available.
  • It runs deno clean before the test.

Other environments

Despite using poolOptions and --experimental-vm-modules running test npm run test:node in node v24 throws ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING.

Top categories

Loading Svelte Themes