博文

目前显示的是 八月 7, 2024的博文

Scripting News: Wednesday, August 7, 2024

图片
Wednesday, August 7, 2024 Timothy Snyder : "If JD Vance really were a normal midwestern guy he'd be very respectful of someone like Tim Walz." # When I see a reference to an evil NYT piece, I RT it with a simple message: Ignore the NY Times. It's relaxing. You don't have to do something about it, in fact it says the opposite. Do nothing. It works on all social nets, and for any news org that's promoting lies, ignoring relevant facts, against the interest of the US. Find new ways to get informed. And if you can't find them, start one. And we can find each other. # The Bruce Springsteen mention at last night's rally was no accident. Boomers are now of the age where we vote in great numbers. So our feeling like there's something here for us might make the difference in one or more of the swing states. # Last night's Democratic rally was wonderful. I was laughing and sobbing all the way through it. What an emotional release. W

🔥 (#177) Mocking in Nuxt Unit Tests

图片
Hey all! If you missed it, Nuxt Tips Collection is now available, with a 20% discount this week only! Get Nuxt Tips Collection now I've also put together an article with a few of my favourite tips: 21 Nuxt Tips You Need to Know And of course, I have some tips for you. Have a great week! — Michael 🔥 Mock Any Import in Nuxt One handy helper method in @nuxt/test-utils is mockNuxtImport . It's a convenience method to make it easier to mock anything that Nuxt would normally auto-import: import { mockNuxtImport } from '@nuxt/test-utils/runtime' ; mockNuxtImport ( 'useAsyncData' , () => { return () => { return { data : 'Mocked data' }; }; }); // ...tests 🔥 Mock Nuxt Components When Testing When testing, you'll often need to shallow render a component — mocking out any descendent components to keep your test simpler. With @nuxt/test-utils you can use the mockComponent utility method