Skip to content

Instantly share code, notes, and snippets.

View creotip's full-sized avatar

Creotip creotip

View GitHub Profile
@mauricedb
mauricedb / Subject under test
Last active December 7, 2023 14:46
Testing stateful React hooks
import { useState } from 'react';
export function useCounter(initial = 0) {
const [count, setCount] = useState(initial);
return [count, () => setCount(count + 1)];
}
@jackawatts
jackawatts / ts-jest.md
Last active June 14, 2023 08:09
Getting started with Typescript, React and Jest

Getting Started

  1. Install:
  • jest: npm install --save-dev jest
  • ts-jest: npm install --save-dev ts-jest @types/jest
  1. Modify package.json
"jest": {
  "transform": {
 "^.+\\.tsx?$": "ts-jest"
@DomPizzie
DomPizzie / README-Template.md
Last active July 15, 2024 17:11
A simple README.md template

Project Title

Simple overview of use/purpose.

Description

An in-depth paragraph about your project and overview of use.

Getting Started