Advertisement ยท 728 ร— 90
#
Hashtag
#JSDom
Advertisement ยท 728 ร— 90

#lumo ๐Ÿฑ ใซ Node.js ใง่‡ชๅ‰ใฎ SSG ็’ฐๅขƒไฝœใ‚‹็›ธ่ซ‡ใ—ใฆใ€#jsdom ใ‚’ไฝฟใฃใŸใ‚‰ใ‚„ใ‚ŠใŸใ„ใ“ใจใŒใงใใใ†ใชๆฐ—ใŒใ—ใฆใใŸใ€‚
่‡ชๅˆ†็”จ๏ผ†ๅ‹‰ๅผท็”จใ ใ‹ใ‚‰ Node.js ใงๅฎŸ่กŒใ™ใ‚‹ JS ใฏๆ€ใ„ใฃใใ‚Šใžๅง”่จ—ใ—ใฆ้ฉๅฝ“ใซๆฑšใๆ›ธใ“ใ†๏ผˆๆฅฝใ—ใฟ :tony_smirking:

0 0 0 0
Testing Zener Card Web Components (Part 3) ๐Ÿง‘โ€๐Ÿ’ป
Testing Zener Card Web Components (Part 3) ๐Ÿง‘โ€๐Ÿ’ป YouTube video by Trees are Green

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

0 0 0 0

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

0 0 0 0

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.

0 0 1 0

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`.

1 0 1 0
Preview
GitHub - capricorn86/happy-dom: A JavaScript implementation of a web browser without its graphical user interface A JavaScript implementation of a web browser without its graphical user interface - capricorn86/happy-dom

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

0 0 0 0
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();
});

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.

0 0 1 0

#vitest #testing #jsdom

1 0 0 0
Preview
Taking LLMs to (code) town - part II. Creating a vanilla.js web component toolchain from ground up I have been developing vanilla web components using a very minimal toolchain, primarily consisting of...

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

4 0 0 0