Gatsby starter used at Good Praxis
This article discusses the Gatsby starter used at Good Praxis, which is set up to use TypeScript, SASS (SCSS), Jest, Cypress, and Helmet. It also mentions the presence of accessibility tests in the Cypress E2E setup. The article provides instructions for setting up the starter, running a development instance, running tests, updating snapshots, and building the website.
To run a development instance of your site, use the following command:
gatsby develop
To run all tests, use the following command:
npm test
To run unit tests specifically, use the following command:
npm run test:unit
To run E2E tests, use the following command:
npm run test:e2e
If you want to run the E2E tests in CI mode, use the following command:
npm run test:e2e:ci
Jest unit tests in the Gatsby starter often compare rendered markup with snapshots. To update the snapshots after making changes to the markup, run the following command:
npm run test:update-snapshots
To build your website, use the following command:
gatsby build
This article introduces the Gatsby starter used at Good Praxis, which incorporates various useful features such as TypeScript, SASS (SCSS), Jest, Cypress, and Helmet. It provides installation instructions and details on how to run a development instance, perform tests, update snapshots, and build the website. This starter aims to enhance code organization, improve testing capabilities, and optimize SEO with Helmet integration.
GatsbyJS is a free and open-source static site generator based on React. It uses a modern development stack including Webpack, GraphQL, and modern JavaScript and CSS frameworks. It also provides a rich set of plugins, starters, and themes.
React is a widely used JavaScript library for building user interfaces and single-page applications. It follows a component-based architecture and uses a virtual DOM to efficiently update and render UI components
SCSS is a preprocessor scripting language that extends the capabilities of CSS by adding features such as variables, nesting, and mixins. It allows developers to write more efficient and maintainable CSS code, and helps to streamline the development process by reducing repetition and increasing reusability.
ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.
Stylelint is a modern linter for CSS that helps you avoid errors and enforce consistent styling conventions. It provides rules for detecting errors and warnings, and can be configured to match your specific project's requirements.
TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.