#lumo ๐ฑ ใซ Node.js ใง่ชๅใฎ SSG ็ฐๅขไฝใ็ธ่ซใใฆใ#jsdom ใไฝฟใฃใใใใใใใใจใใงใใใใชๆฐใใใฆใใใ
่ชๅ็จ๏ผๅๅผท็จใ ใใ Node.js ใงๅฎ่กใใ JS ใฏๆใใฃใใใๅง่จใใฆ้ฉๅฝใซๆฑใๆธใใ๏ผๆฅฝใใฟ :tony_smirking:
Little late getting this up. This is the live stream from last week. Continuing setting up a frontend testing framework using JSDOM and the Node Test Runner for our research platform.
www.youtube.com/watch?v=bgB6...
#parapsychology #zenercards #nodejs #testing #jsdom #treesaregreen
Replay of this week's session. Be sure to join us live next Thursday. Check here the day of for time.
Part 1: www.youtube.com/watch?v=8qEH...
Part 2: www.youtube.com/watch?v=1-31...
www.twitch.tv/treesaregreen/
#parapsychology #research #development #webcomponents #testing #jsdom #nodejs
3. I upgraded #CleanCSS.
4. I removed #JSDom and replaced it with #parse5, which works with `@layer`.
5. I wanted to use `Object.groupBy` here which requires `target: "ES2024"` in #TypeScript.
6. Therefore I needed to upgrade TS.
7. Upgrading TS broke #Karma for reasons I couldn't understand.
Over the last few days while working on an upcoming blog post I've performed quite the yak shaving:
1. I wanted to use `@layer` in a #CSS demo (ironically one showing that it doesn't solve this particular use case).
2. My auto #CSP setup using #JSDom and #CleanCSS failed to parse `@layer`.
Has anyone used #happydom and can tell me if it's better than #jsdom? Happy DOM is advertised as faster, but where's the catch? github.com/capricorn86/... #frontend #web #javascript
const mockAssign = vi.fn(); const mockOpen = vi.fn(); beforeEach(() => { Object.defineProperty(window, 'location', { configurable: true, value: { ...window.location, assign: mockAssign, }, }); Object.defineProperty(window, 'open', { ...window.open, configurable: true, writable: true, value: mockOpen, }); }); afterEach(() => { vi.restoreAllMocks(); });
Today, I came across this small piece of code for mocking, but I'm not sure if it's a good approach.
The environment is #JSDOM, and the testing tool is #Vitest.
The purpose of this test is to mock "window.location.assign" and "window.open"
Test experts, help.
So when everyone was out on christmas, I did a thing. I renamed the thing and I blogged about it.
dev.to/sebs/taking-...
#webcomponents #windsurf #vanillajs #typescript #tdd #jsdom