{"_id":"vitest-canvas-webgl-mock","name":"vitest-canvas-webgl-mock","dist-tags":{"latest":"2.5.3"},"versions":{"2.5.3":{"name":"vitest-canvas-webgl-mock","version":"2.5.3","description":"Mock both 2D and WebGL contexts in Vitest.","main":"lib/index.js","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/"},"scripts":{"test":"vitest run","build":"babel src --out-dir lib","prepare":"npm run build","prettier":"prettier --write ."},"dependencies":{"cssfontparser":"^1.2.1","moo-color":"^1.0.2"},"devDependencies":{"@antv/g2plot":"^2.3.11","@babel/cli":"^7.8.4","@babel/core":"^7.9.0","@babel/plugin-proposal-class-properties":"^7.8.3","@babel/preset-env":"^7.9.5","@commitlint/cli":"^17.6.1","@commitlint/config-angular":"^17.6.1","@inrupt/jest-jsdom-polyfills":"^2.5.0","babel-plugin-version":"^0.2.3","coveralls":"^3.0.11","husky":"^4.2.5","jsdom":"^22.1.0","prettier":"^2.0.4","vitest":"^2.1.0"},"commitlint":{"extends":["@commitlint/config-angular"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run prettier && npm run test && npm run build"}},"repository":{"type":"git","url":"git+https://github.com/nolanzxh/vitest-canvas-webgl-mock.git"},"keywords":["mock","vitest","vitest-mock","echarts","canvas","test","unit","stub","webgl","pixi","pixi.js","pixijs"],"author":{"name":"zxianhua & adamfsk"},"license":"MIT","bugs":{"url":"https://github.com/nolanzxh/vitest-canvas-webgl-mock/issues"},"homepage":"https://github.com/nolanzxh/vitest-canvas-webgl-mock#readme","_id":"vitest-canvas-webgl-mock@2.5.3","gitHead":"90cdd076c659a9149beecef55b6bb16b242f4e24","_nodeVersion":"20.17.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-8frxnNijdoz8HB0/fBQ1xJUSEBuv1tdjXxwP0VigztvmFRQ3MVq71KbBgjp6nahhM9IYZczz67ERYOToxL6WtQ==","shasum":"ff2105a186f99fc2bbb333f210e065a0e5bce75c","tarball":"https://registry.npmjs.org/vitest-canvas-webgl-mock/-/vitest-canvas-webgl-mock-2.5.3.tgz","fileCount":20,"unpackedSize":123423,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBWbCvwLVHQsRRedQj7Ec69OQUPUmn7oGeQK0uAT/g6RAiArToENhF1XpmHLalVpnCwhDsjxtCWsbAGNfmk4Sk/hOw=="}]},"_npmUser":{"name":"nolan_zxh","email":"zhouxianhua0@gmail.com"},"directories":{},"maintainers":[{"name":"nolan_zxh","email":"zhouxianhua0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vitest-canvas-webgl-mock_2.5.3_1726216543342_0.5282288975397196"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-13T08:35:43.342Z","2.5.3":"2024-09-13T08:35:43.520Z","modified":"2024-09-13T08:35:43.762Z"},"maintainers":[{"name":"nolan_zxh","email":"zhouxianhua0@gmail.com"}],"description":"Mock both 2D and WebGL contexts in Vitest.","homepage":"https://github.com/nolanzxh/vitest-canvas-webgl-mock#readme","keywords":["mock","vitest","vitest-mock","echarts","canvas","test","unit","stub","webgl","pixi","pixi.js","pixijs"],"repository":{"type":"git","url":"git+https://github.com/nolanzxh/vitest-canvas-webgl-mock.git"},"author":{"name":"zxianhua & adamfsk"},"bugs":{"url":"https://github.com/nolanzxh/vitest-canvas-webgl-mock/issues"},"license":"MIT","readme":"# vitest-canvas-webgl-mock\n\n> Mock `canvas` and `WebGL` when running unit test cases with vitest.\n\n## Disclaimer\n\nThe project is inspired by [vitest-webgl-canvas-mock](https://github.com/RSamaium/vitest-webgl-canvas-mock), and is a fork of [jest-webgl-canvas-mock](https://github.com/Adamfsk/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.\n\nThe current goal of this project is simply to make any tests using `pixi.js` work in vitest.\n\nPlease feel free to contribute and add any additional functionality required.\n\n## Install\n\nThis should only be installed as a development dependency (`devDependencies`) as it is only designed for testing.\n\n```bash\nnpm i vitest-canvas-webgl-mock\n```\n\n## Setup\n\nIn `__setups__/canvas.js`\n\n```js\nimport 'vitest-canvas-webgl-mock';\n```\n\nIn `vitest.config.js`\n\n```js\nimport { defineConfig } from 'vite'\n\nexport default defineConfig({\n    test: {\n        setupFiles: ['__setups__/canvas.js']\n        environment: 'jsdom'\n    }\n})\n\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}