New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vitest-webgl-canvas-mock

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vitest-webgl-canvas-mock

Mock both 2D and WebGL contexts in Vitest.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3K
decreased by-37.27%
Maintainers
1
Weekly downloads
 
Created
Source

vitest-webgl-canvas-mock

Mock canvas and WebGL when running unit test cases with vitest.

Disclaimer

This project is a fork of jest-webgl-canvas-mock so that both 2d and webgl contexts can be tested in vitest. As such, the only tests provided are those from the original projects.

The current goal of this project is simply to make any tests using pixi.js work in vitest.

Please feel free to contribute and add any additional functionality required.

Install

This should only be installed as a development dependency (devDependencies) as it is only designed for testing.

npm i vitest-webgl-canvas-mock

Setup

In __setups__/canvas.js

import 'vitest-webgl-canvas-mock';

In vitest.config.js

import { defineConfig } from 'vite'

export default defineConfig({
    test: {
        setupFiles: ['__setups__/canvas.js']
        environment: 'jsdom'
    }
})

License

MIT

Keywords

FAQs

Package last updated on 28 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc