Spencer FengMastering the Art of Mocking ES Modules in JestWe value jest.spyOn’s flexibility for modifying function returns, but it falls short with ES modules. This article introduces an…·2 min read·Dec 13, 2023----
Spencer FengTesting JavaScript Code with Timeouts and PromisesTesting JS code with timeouts and promises can be challenging. In this article, we show an example to test such code.·2 min read·Jul 1, 2023----
Spencer FengHow to use PlantUML in VSCodeLearn to create diagrams with code easily using PlantUML & VSCode. Our article provides step-by-step instructions to streamline the…·4 min read·Mar 5, 2023----
Spencer FengCreate an abortable API using AbortController and AbortSignalHow create an abortable API using AbortController and AbortSignal the right way.·2 min read·Jul 25, 2022----
Spencer FengThe journey of creating a serverless service to scrape contents from a web pageIn this article, I will share my experience of using Serverless Framework to build a service to extract the HTML content of a web page and…·5 min read·Apr 30, 2022----
Spencer FenginBetter ProgrammingStore an Array of Custom Data Types in Core Data With Transformable and NSSecureCodingPersist the user’s drawings in Core Data·3 min read·Mar 5, 2022--1--1
Spencer FengHow to replace async code using completion handler with Future from Combine FrameworkThis article talks about how to turn your callback based API into a reactive based API using Future from Combine Framework.·1 min read·Nov 8, 2021----
Spencer FengHow to avoid race condition when accessing properties in a singleton using GCDHow to avoid race condition when accessing properties in a singleton using Grand Central Dispatch·1 min read·Nov 4, 2021----
Spencer FengHow to mock lodash throttle in JestThis article talks about how to mock lodash throttle function in Jest and this techique can be applied to lodash debounce function as well.·1 min read·Aug 14, 2021----
Spencer FengCreate a custom file upload control in ReactThe file upload control that comes with browsers looks ugly. This article talks about how to create a custom file upload control in React.·1 min read·Mar 20, 2021----