Skip to content

Repository files navigation

rstest-canvas-mock

Mock canvas when running tests with rstest. Uses jest-canvas-mock.

Install

npm install rstest-canvas-mock -D

Usage

  1. Create a new setup file that imports rstest-canvas-mock or add it to an existing setup file.
// rstest.setup.ts
import 'rstest-canvas-mock';
  1. In your rstest.config.ts file, create a setupFiles array and add that file:
import { defineConfig } from '@rstest/core';

export default defineConfig({
  setupFiles: ['./rstest.setup.ts'],
  testEnvironment: 'jsdom',
});

Mock Strategy

Reference jest-canvas-mock#mock-strategy.

Snapshots

Reference jest-canvas-mock#snapshots

License

MIT.

About

Mock canvas in Rstest

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

Sponsor
SponsoredKunjungi sekarang
Promo