Skip to content

Instantly share code, notes, and snippets.

View ranpa's full-sized avatar

Nélson Rangel ranpa

  • OneFootball
  • Berlin - Germany
View GitHub Profile
@ranpa
ranpa / usePolling.spec.ts
Created May 23, 2023 13:08
Test scenarios for a declarative way of calling a callback from time to time (polling)
import {
afterAll,
afterEach,
beforeAll,
describe,
expect,
test,
vi,
} from "vitest";
import { renderHook } from "@testing-library/react";
@ranpa
ranpa / useInterval.spec.ts
Created May 23, 2023 12:32
Test scenarios for a declarative implementation of the setInterval method
import {
afterAll,
afterEach,
beforeAll,
describe,
expect,
test,
vi,
} from "vitest";
import { renderHook } from "@testing-library/react";
@ranpa
ranpa / useTimeout.spec.ts
Created May 23, 2023 12:31
Test scenarios for a declarative implementation of the setTimeout method
import {
afterAll,
afterEach,
beforeAll,
describe,
expect,
test,
vi,
} from "vitest";
import { renderHook } from "@testing-library/react";