Gp Gatsby Starter Ts Sass Jest

screenshot of Gp Gatsby Starter Ts Sass Jest
gatsby
react
scss

Gatsby starter used at Good Praxis

Overview:

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.

Features:

  • TypeScript: The Gatsby starter is set up to use TypeScript for enhanced static typing and improved code organization.
  • SASS (SCSS): The starter supports the use of SASS (SCSS) for writing more modular and maintainable CSS styles.
  • Jest: Jest is utilized for running unit tests in the Gatsby starter.
  • Cypress: Cypress is used for running end-to-end (E2E) tests, including accessibility tests.
  • Helmet: The Gatsby starter incorporates Helmet, a library that helps with managing the document head in React-based applications.

Usage:

Development:

To run a development instance of your site, use the following command:

gatsby develop

Testing:

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

Updating Snapshots:

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

Building:

To build your website, use the following command:

gatsby build

Summary:

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.

gatsby
Gatsby

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
React

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
SCSS

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
Eslint

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

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
Typescript

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.