Lape

Lape

  • Docs
  • GitHub

›Guides

Getting Started

  • Getting Started
  • Thinking in Lape

API

  • lape
  • connect
  • useLape
  • useLapeEffect
  • undo / redo
  • ignoreState
  • lapeTrackUseState

Guides

  • Testing
  • Routing

Testing

We think that testing components is an important part of the development workflow. Mutable state is notoriously difficult to test, but Lape makes this easy.

Lape can reset state after each test, your tests should never rely on the execution order. Use the lapeTrackAllChanges and lapeResetAllChanges functions.

import { lapeResetAllChanges, lapeTrackAllChanges } from "lape/testing";

beforeEach(() => {
  lapeTrackAllChanges();
});

afterEach(() => {
  lapeResetAllChanges();
});

If you are using jest, add this to setupFilesAfterEnv and you will not need to think about state being shared in tests.

Examples

Check internal lape tests

← lapeTrackUseStateRouting →
  • Examples
Lape
Docs
Getting StartedAPI ReferenceGuides
Other Projects
Ugnis
More
GitHubStar
Copyright © 2021 Ugnis. All Rights Reserved.