Your TypeScript application uses relative imports. Every time you move a file, the imports break. You've configured path mapping, and now things break in an entirely new way.
You need to check a date using Chai. You also need to account for the test execution time.
Gatsby supports TypeScript out-the-box. Unfortunately, the official solution has several shortcomings which limit its usefulness. There is a better way.
You're using Netlify CMS to manage the content of your Gatsby-powered website. The default Netlify CMS preview displays every field, including metadata. That probably isn't what you want.
JSON Schema includes the multipleOf keyword. This is very useful for checking that a number is rounded to a specific number of decimal places.
Your site uses Gatsby and Netlify CMS. Tailwind and PostCSS take care of the styling. You run
gatsby develop, and encounter a cryptic error message.
Chai lets you assert that some code throws an error. The key is to pass the test subject to
expect, not the test result.
You can disable ESLint for a single line, a block of code, or an entire file. Wherever possible, specify the rule or rules you wish to disable.
Don't use "deep equals" when comparing arrays with Chai; it depends on element order. Examine the array members instead.
TypeScript's strict type checking can cause problems when working with numeric environment variables. Here's a solution.
bravo. We need to determine which items appear in
alpha, but not in
Array.prototype.push. It modifies the array in place, which is asking for trouble. It also returns the array length, not the modified array, which is plain confusing.
The default "recurse depth" of
console.dir is 2. This is rarely what I want.
faker.random.words(3) generates a string containing three random words. But what if you want to generate an array of random words?
Statecharts are a very useful tool for modelling complex workflows in your application.
Sign up for my newsletter
A monthly round-up of blog posts, projects, and internet oddments.