How do I solve " Failed to resolve import "$app/paths" with Svelte and Vitest
I have been working on Svelte library, and I just started configuring and writing unit tests for it. Vitest was set up and configured, but when running tests I Was getting an error like this: FAIL...
View ArticleWhat is the Difference between public and src/assets in a Vite project?
I'm doing some research for an article I'm writing about building VueJS libraries. Creating a default VueJS application with Vite creates a public directory in the root directory--which includes a...
View ArticleHow do I nextTick() in Vitest without Vue?
I wrote a bunch of tests on a Vue project using Vitest, and had pretty good success with it. Quite a few tests deal with asynchronous code, such as a service call that returns a promise. Tick's in Vue...
View ArticleConstructor Overloading with Angular Injected Services
I wrote a bit about constructor overloading in TypeScript a week ago. My use case, is that I had a bunch of libraries for different UI Frameworks that shared a lot of code. I was creating a generic...
View ArticleContructor Overloading in TypeScript
I'm working on a creating a TypeScript library that will be used across multiple frameworks including Vue, Angular, React, and Svelte. It is an interesting challenge. Along the way I discovered that...
View ArticleChocolate Peanut Butter Banana Ice Cream (Dairy Free)
My home recipe for Chocolate Peanut Butter Banana Ice Cream. IngredientsBase Ice Cream Recipe1.5 jars of Creme of Coconut. I use Goya brand. This is about 22.5 ounces2 cups of Milk: I've been using So...
View ArticleHow do I implement Observable Pipes with Promises?
I was migrating some code from Angular to VueJS. This is code to retrieve some data from a server and process it. The Angular code using Observables, and you can use pipes to run different actions to...
View ArticleDescribe is not defined when running Vitest from IntelliJ
I've been working with Vue, and Vitest and was trying to get my IntelliJ configuration up to snuff so I could write and debug tests. I had a few problems along the way to get tests working at both the...
View ArticleHow do I figure out the latest version of an npm package?
This question came up in one of the reddits I'm on. Someone wanted to use an API to figure out the latest version of Angular, in order to evaluate whether or not they were using the most up to date....
View ArticleHow do you reset a spy with Jasmine?
I've been writing some unit tests. A common scenario thing that sends me to the blog. I had a method that called another method. That's a pretty common scenario. I wanted to spy on the method call to...
View ArticleHow can I run the linux CP command on Windows?
I do Web Development on a Windows Machine! That isn't a confession and I'm not embarassed. Windows is the 'devil' I know, and I work well with it. In 90% of the cases I can check out a repo, run npm...
View ArticleHow do you spy on a method inside a constructor with Jasmine?
I've been working with Angular for a while. In Angular components, the constructor is often kept blank and any sort of initialization methods are moved into ngOnInit(). If I have to spy on any method...
View ArticleHow do you Write an Amazing Developer Ticket?
A ticket, or story, is a single piece of developer work, and the code from multiple tickets comes together to form bigger projects. I've dealt with a lot of poorly written tickets in my career, and at...
View ArticleHow do you Prepare Before You Code?
Let's pretend you, a programmer, have been given this task: Display Subtotal to the Customer The task may sound like a valid request on first read, but I have a ton of questions: What subtotal are we...
View ArticleShould Engineering Manager’s Write Code?
I've found that in tech, a common way for a successful programmer to move up the corporate ladder is to step into a management role. There seem to be more roles in engineering management than there...
View ArticleHow Do I Name a Unit Test?
It is common to say that unit tests are documentation. I've always hated that saying, because people seem to use it to avoid writing tutorials or other documentation. However, I eventually conceded...
View ArticleHow to change the return value of a Spy in Jasmine?
Recently I was modifying some unit tests in Angular. The code was spying on a property and returning a value. Something like this: beforeEach(function() { spyOnProperty(component, "myValue",...
View ArticleReact Tic Tac To Expansion: Display Move Location
This video expands the React Tic Tac Toe Tutorial to display the coordinates of the move in the history list. View the Video Check out the source code from this sample in my GitHub
View ArticleReact Tic Tac To Expansion: Winning Square Highlights
This video expands the React Tic Tac Toe Tutorial to highlight the winning squares, or tell the user that the game ends in a draw. View the Video Check out the source code from this sample in my GitHub
View ArticleReact Tic Tac To Expansion: Toggle History Direction
This video expands the React Tic Tac Toe Tutorial to dynamically create the game board. View the Video Check out the source code from this sample in my GitHub
View Article