lim
lim
DDeno
Created by lim on 11/3/2023 in #help
Component testing with Deno
I've run through a zillion possible setups with Deno and I'm still struggling to understand exactly how to do this. I want to write Typescript that transpiles to vanilla web components and I want to run associated unit tests in a component.test.ts that sits beside my component in a folder. I want these unit tests to be able to spin up a dom to test things like saving to localStorage. And I want this to be as simple and minimal as possible. I've explored just writing everything from scratch with Deno, and I couldn't quite grasp how to get esbuild to output my components as separate modules and it looked like I'd have to basically write my own build scripts, like the pre-Gulp days. I have installed vite and tried out vite vanilla, vite-lit, and vite-svelte. I thought vite-svelte was my saviour but again I just couldn't get the testing working. When I tried to install vitest I kept hitting this error: Error: Vitest was initialised with native Node instead of Vite Node and could progress no further. Does anyone know of a tutorial or starter kit that has testing set up properly? That isn't hugely elaborate or very outdated?
7 replies