Topic: JavaScript
How to set up unit tests for Astro components
Improve your Astro unit testing experience by adding happy-dom and DOM Testing Library to your setup.
Dependencies vs. devDependencies for JavaScript apps
Whenever I'm adding a new dependency to a JavaScript app, or setting up the build process of a new app, I ask myself: what exactly are devDependencies? It's time to answer that question in depth.
Rewriting a Vue app to Astro
I rewrote my hobby project to Astro and its JavaScript bundle size shrank 3x.
How to change your local timezone on a mac to debug date-related JavaScript tests
My date-related JavaScript tests were passing locally, but failing on CI. Changing my local timezone helped me find the bugs.
How to require the document to start with an h1 in TipTap?
If we're writing a blog post editor, something that we might need is to require the blog post to start with a title. TipTap can do that for us.
How to allow editing image alt text in TipTap?
Image alt text is a crucial accessibility and SEO feature that every rich text editor should support.
How to prevent yourself from running npm in a yarn project or the other way around?
Depending on which project I worked on most recently, my muscle memory causes me to type the wrong command when switching projects.
Migrating a React app from JavaScript to TypeScript
Recently we rewrote a medium-sized React app from JavaScript to TypeScript. Here's how we approached the task.
Fake skip links in Vue Router
How to allow users to skip chunks of content in your Vue app when the hash part of the URL is hijacked by Vue Router.
Providing custom error messages for built-in HTML5 form validation
Did you know that you can change the error messages displayed by the browser when using HTML5 form validation features?
Colorizing Names
How I figured out how to assign colors to branch names - deterministically, but seemingly random to a human.
Scroll spy - heading breadcrumbs
Keep track of the headings that describe the current paragraph of a long article.
Rubyist's first attempt at testing JavaScript
How to do everything that RSpec can do, but with Mocha, Chai, Sinon, and Proxyquire.