{"_id":"jest-webgl-canvas-mock","_rev":"9-6c6092b6c86ff2b4db47aa0b233f7e3f","time":{"0.2.0":"2019-07-04T11:58:42.904Z","created":"2019-07-08T20:18:11.648Z","0.2.1":"2019-07-08T20:18:11.858Z","modified":"2023-10-30T16:09:56.220Z","0.2.2":"2019-07-09T23:49:25.200Z","0.2.3":"2019-11-19T22:51:38.706Z","2.5.0":"2023-05-03T15:27:59.079Z","2.5.2":"2023-10-30T14:18:51.802Z","2.5.3":"2023-10-30T16:09:56.046Z"},"name":"jest-webgl-canvas-mock","dist-tags":{"latest":"2.5.3"},"versions":{"0.2.1":{"name":"jest-webgl-canvas-mock","version":"0.2.1","description":"Mock both 2D and WebGL contexts in Jest.","main":"lib/index.js","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/"},"scripts":{"test":"jest --no-cache","build":"babel src --out-dir lib","coveralls":"cat ./coverage/lcov.info | coveralls","prepare":"npm run build"},"dependencies":{"cssfontparser":"^1.2.1","parse-color":"^1.0.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.4","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/preset-env":"^7.4.4","@commitlint/cli":"^7.5.2","@commitlint/config-angular":"^7.5.0","babel-jest":"^24.8.0","babel-plugin-version":"^0.2.3","coveralls":"^3.0.3","husky":"^2.2.0","jest":"^24.8.0"},"commitlint":{"extends":["@commitlint/config-angular"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run test && npm run build"}},"jest":{"collectCoverage":true,"collectCoverageFrom":["src/classes/**/*.js","src/mock/**/*.js"],"setupFiles":["./src/index.js"]},"repository":{"type":"git","url":"git+https://github.com/adamfsk/jest-webgl-canvas-mock.git"},"keywords":["mock","jest","jest-mock","echarts","canvas","test","unit","stub","webgl","pixi","pixi.js","pixijs"],"author":{"name":"adamfsk"},"license":"MIT","bugs":{"url":"https://github.com/adamfsk/jest-webgl-canvas-mock/issues"},"homepage":"https://github.com/adamfsk/jest-webgl-canvas-mock#readme","gitHead":"343093cb6d7f09ecccf03c4417691a956357d545","_id":"jest-webgl-canvas-mock@0.2.1","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"adamfsk","email":"adamfsk@gmail.com"},"dist":{"integrity":"sha512-n5LD3nKTy5JMcv3szUR4lKg+68XZON08rhYkR/RUHL+MLQvXYujDEahsmFw6pwTIO/zfpyzlUDxmUvz6aBch2w==","shasum":"2631a6c19a44d687c8022c723a135054996dad10","tarball":"https://registry.npmjs.org/jest-webgl-canvas-mock/-/jest-webgl-canvas-mock-0.2.1.tgz","fileCount":21,"unpackedSize":132590,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdI6UECRA9TVsSAnZWagAAfVoP/1DjMeyYtYo8U78jjnRU\nr3GXYbMF9Q3nkWbzVyeGPmuXeNT7UPITHjbkTZFjD1LR9LqkZkmsXq+U354t\n+vx5Xg2QRSIZN4k2G0Zdu+PfUIwb5unBFJpQcQ3nNAShC5ZFfc4YuF+2tnYx\nplNDw+/GFE6C8Kw76+WIglcJ1ued0qL4rewQEkl1ijjmZdrRBADjxLG9ZNhJ\nnBz0bGHvwAbHSZpocusRGcCy4547MSqTbwyfc10+FEBn9Rc3TM0GLQPXlvm9\nUPPP81l3I1wHv/ODY57rJKWKdGGcFNPZggiIbGS6bnLB/kN5Bf+env7KCf6V\nBIVzI40p9HtXGAlP00fkvPBqV2t6jo+77q8ohPlHcNIZeSF+3NwIXgE1FKUr\nhsAxy4sgBDNbrb77OWHd0mI5HoruuaQy8PkiiCRlvBvsBuukhZoeg3vsoeXz\nPJJ5Cs0vaAPuVua/vv0AOqXhrdjsdQ+iM7860KxaD2y9ZigMYD2SLbfF1o51\nR17OrC/mjwq/IRT1g4LCK/JVrRgEC3yEuU6HsxZRdrJCFA68+1kUs0mn5Zor\nmeDAgB3J17wLZ/koFIZl2jx2mjIat4CCFUT3q1egyFUGtizXHzOyuF0nEBGC\nFDRr1zyJPiR+vmZRGq11DwXUUavlC3/+HvnDOl/8C0WBAM2c4MbPWHIunEvz\nLZos\r\n=Aaw/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEHYvQucyxlFcTXNl9vWMUQ8/I8idGpLAMLmTDpJvSZTAiEA6QwR0xL0yTGKSevocqFUceT4xKKfCFKdI5njzTH4kh8="}]},"maintainers":[{"name":"adamfsk","email":"adamfsk@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-webgl-canvas-mock_0.2.1_1562617091648_0.6878184171841146"},"_hasShrinkwrap":false},"0.2.2":{"name":"jest-webgl-canvas-mock","version":"0.2.2","description":"Mock both 2D and WebGL contexts in Jest.","main":"lib/index.js","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/"},"scripts":{"test":"jest --no-cache","build":"babel src --out-dir lib","coveralls":"cat ./coverage/lcov.info | coveralls","prepare":"npm run build"},"dependencies":{"cssfontparser":"^1.2.1","parse-color":"^1.0.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.4","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/preset-env":"^7.4.4","@commitlint/cli":"^7.5.2","@commitlint/config-angular":"^7.5.0","babel-jest":"^24.8.0","babel-plugin-version":"^0.2.3","coveralls":"^3.0.3","husky":"^2.2.0","jest":"^24.8.0"},"commitlint":{"extends":["@commitlint/config-angular"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run test && npm run build"}},"jest":{"collectCoverage":true,"collectCoverageFrom":["src/classes/**/*.js","src/mock/**/*.js"],"setupFiles":["./src/index.js"]},"repository":{"type":"git","url":"git+https://github.com/adamfsk/jest-webgl-canvas-mock.git"},"keywords":["mock","jest","jest-mock","echarts","canvas","test","unit","stub","webgl","pixi","pixi.js","pixijs"],"author":{"name":"adamfsk"},"license":"MIT","bugs":{"url":"https://github.com/adamfsk/jest-webgl-canvas-mock/issues"},"homepage":"https://github.com/adamfsk/jest-webgl-canvas-mock#readme","gitHead":"7b97235c6a9d028bed91fb715ebec621ab303cb2","_id":"jest-webgl-canvas-mock@0.2.2","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"adamfsk","email":"adamfsk@gmail.com"},"dist":{"integrity":"sha512-Ni13XyJKPEFNctHczkFAZecTYXMdxuAJh5B418nr46k2x7RaL+cEAYj+KRZOEzXyC0CA7+FAqE0siQLS2g5WHw==","shasum":"affb7d719fd0e381478f89e7f3a258fabd02125f","tarball":"https://registry.npmjs.org/jest-webgl-canvas-mock/-/jest-webgl-canvas-mock-0.2.2.tgz","fileCount":21,"unpackedSize":135541,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJSgFCRA9TVsSAnZWagAAM0QP/i0ePjzM2WYB2EqP622G\nu3WEAgKmkd6aWZBCy9poFp8qb6TkMWDsze3kNGCo0gPp+dWc/loCMeG5axn3\nQo8rPQ25ghk+ZJVTTl8VSgMmdQGyUzpYiFxZFbaAGdzJRacLYLLvh8Slzxeo\n8hhY0j3q5qUJ43Z8Cn5pLBzMbWYbso515aRehNI+vP82KUlnpHVGroL5+lda\noLSNLZ2SotM+W2Zzetnw8LH43FPAvuOA2u+voMB2At6oaT4WsVVK1CL8fAKE\nKUXtPsqtpww9LKm35WG2XwVqIlrNzzrEUHwXv4AdHAWi3MwkW5rpScpEi8Pj\n2RpN3LuOYwGxZjASmUvgR2DPTq+BBhC7rk5WIXT6TxyQBs5thFF1ChC7hPqr\nWjL9Cv2SUDmkebf30jom0oTpjFIjsRvVdEP6C6KgkmEHAoxabnYn4jkwuUX1\n/OU883Jc4q/fcBjjUHHMw/JTr0qkuoKYnHxv+wIl3i7aUGtfScy7k7qQu2jA\noPWceOheq7zYuQdyr7W3F+hyNbZhykXpvDLcnwgFRfyGutzIUAPwK27kQ5Lk\n4DBLszfcYtwr8bpVMX7rgBh3Zp2qdNJg+gN0cxDRbV1qqVKODsr3NzLa0sDs\nPfbT2wOSQUJ6rd7gmDO4jQoePvo0AGQVcx3TrWfkwK1ZwNA8FfzovQdcNxiu\nZn/4\r\n=8WXf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA2OkmVplc0DpgrivICoLA4urCkZd2Gxod/qlRmQHLWMAiAkaIkmriJ4cNaBfnBWGZBI7UPsOW7SmnN5w/+vGUGWIg=="}]},"maintainers":[{"name":"adamfsk","email":"adamfsk@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-webgl-canvas-mock_0.2.2_1562716165032_0.9622199749998148"},"_hasShrinkwrap":false},"0.2.3":{"name":"jest-webgl-canvas-mock","version":"0.2.3","description":"Mock both 2D and WebGL contexts in Jest.","main":"lib/index.js","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/"},"scripts":{"test":"jest --no-cache","build":"babel src --out-dir lib","coveralls":"cat ./coverage/lcov.info | coveralls","prepare":"npm run build"},"dependencies":{"cssfontparser":"^1.2.1","parse-color":"^1.0.0"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.4","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/preset-env":"^7.4.4","@commitlint/cli":"^7.5.2","@commitlint/config-angular":"^7.5.0","babel-jest":"^24.8.0","babel-plugin-version":"^0.2.3","coveralls":"^3.0.3","husky":"^2.2.0","jest":"^24.8.0"},"commitlint":{"extends":["@commitlint/config-angular"]},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run test && npm run build"}},"jest":{"collectCoverage":true,"collectCoverageFrom":["src/classes/**/*.js","src/mock/**/*.js"],"setupFiles":["./src/index.js"]},"repository":{"type":"git","url":"git+https://github.com/adamfsk/jest-webgl-canvas-mock.git"},"keywords":["mock","jest","jest-mock","echarts","canvas","test","unit","stub","webgl","pixi","pixi.js","pixijs"],"author":{"name":"adamfsk"},"license":"MIT","bugs":{"url":"https://github.com/adamfsk/jest-webgl-canvas-mock/issues"},"homepage":"https://github.com/adamfsk/jest-webgl-canvas-mock#readme","licenseText":"MIT License\n\nCopyright (c) 2019 Adamfsk\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"jest-webgl-canvas-mock@0.2.3","dist":{"shasum":"70f978b724d382e716b620096476293fca71ca26","integrity":"sha512-82QePnztfps/CZMJP60gKeWEaMPz/ZOpcX+ayhkg9uKJ4+YyHmrWu0FTD+Z1FVcKeP5dqAY2Rv5ZG3msIKpSEA==","tarball":"https://registry.npmjs.org/jest-webgl-canvas-mock/-/jest-webgl-canvas-mock-0.2.3.tgz","fileCount":27,"unpackedSize":443417,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1HH7CRA9TVsSAnZWagAA3JwQAJqp9eBjRLxUacalUxx9\nq8MDwH5SkN11MErTEs7bbHN/0kD1SD7ayhQnWZQgSbCHbaD85aJgsDJalkjV\nilt3OMBzUgmDkGVd2v6KQmko4NFPzsoRrJETytvwBTP8Vo5LinzCJ7wcrs4o\nhnZbnwhj8r9vWBECS/jTI9yjZeNKbjyHiXqW15l3LtAJk2QDbvHnZdpAj6Ag\nqfS2hSfbgpV8LnmBWdaaFjf9jBmJ4V6xk4tkwNlbgGcqxEY8tT7/uV7fF1iW\n/XajdlystKl9sFc8ZWWZo3Ch01m7QAdd+jRSbmUQUxC/GAOVsb78iFgew1dJ\nkP9hQLuN8lNxuw67cLNaQmzikaiIdyh2WpOm26U22PPYHBxOZjXU001EAK0C\nZhPYALf2WN6f6qFrr4j/KOcHSujMcpPdz9vl7jLtOHIsW6O9aXdqKkgDamMC\nuD86g9WzMBDjk2EnUaMxKFGvTDV27AVZY9PNtcSsogwH8hmljE542CVTP06l\nu3luQiFA+idUeXsQWZlSKSKVEWZPVjbD4Vey/LiXkLzcbyvedqbTrle4taz7\nB3m9ZITK+TDG/PHWuIZmzHY8Dq2R2TZ4HBeX7AhyYutCX+KLB4CGYm+HwPp9\n9YI5x5Q0Yld6Dl6yS5wOUIyLdbUHYkdwteziFpLHkLn4N+c/22zRUh6EmCKc\n9v4h\r\n=gWGg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIESKoA3ptXUdI5VlEHVg5+TT8nuGIAkTFgIzruk0okMRAiBghXSaq5rtz6lhA4IdecmAMW+eJ0JiFV71lUJyqW6NOg=="}]},"maintainers":[{"name":"adamfsk","email":"adamfsk@gmail.com"}],"_npmUser":{"name":"adamfsk","email":"adamfsk@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-webgl-canvas-mock_0.2.3_1574203898601_0.3706169967103592"},"_hasShrinkwrap":false},"2.5.0":{"name":"jest-webgl-canvas-mock","version":"2.5.0","description":"Mock both 2D and WebGL contexts in Jest.","main":"lib/index.js","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/"},"scripts":{"test":"jest --no-cache","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","babel-jest":"^25.3.0","babel-plugin-version":"^0.2.3","husky":"^4.2.5","jest":"^29.5.0","jest-environment-jsdom":"^29.5.0","prettier":"^2.0.4"},"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"}},"jest":{"testEnvironment":"jsdom","collectCoverage":true,"collectCoverageFrom":["src/classes/**/*.js","src/mock/**/*.js"],"setupFiles":["./src/index.js","./__mocks__/worker.js"]},"repository":{"type":"git","url":"git+https://github.com/adamfsk/jest-webgl-canvas-mock.git"},"keywords":["mock","jest","jest-mock","echarts","canvas","test","unit","stub","webgl","pixi","pixi.js","pixijs"],"author":{"name":"adamfsk"},"license":"MIT","bugs":{"url":"https://github.com/adamfsk/jest-webgl-canvas-mock/issues"},"homepage":"https://github.com/adamfsk/jest-webgl-canvas-mock#readme","gitHead":"0ce2974715ec01b48ace811750cd00ae58d88c3c","_id":"jest-webgl-canvas-mock@2.5.0","_nodeVersion":"18.13.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-QwnLoP3KecODV/LSO1BvgsTI1/r2jdSxsdrMfQgMr6WSchQqvsCroAp1ebfiuDRUf4/UKAXfrP65j7z6OsOWfA==","shasum":"2491b70b31a9365412c5108d4128ce9ff6be7fce","tarball":"https://registry.npmjs.org/jest-webgl-canvas-mock/-/jest-webgl-canvas-mock-2.5.0.tgz","fileCount":20,"unpackedSize":127436,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBel7aoXyBQf+2sr/iuap2NiMGJsx0vNOl1H7x+geS6AiEAqjeFeEJyv5CD7ujANdMMw9Yl4j5x8uLtkiHo+4ve8QU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUn1/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoZBw/+OFGGVm4PQu7HApK0cMMxhL1TGArvh/VpfC62kQlpxIzRcWpH\r\nP+NDXtlojzMgKfW0GB8yKnLxWUxH03dxlY9Frvb0Hod0rfST7VIOyGSfBD7Z\r\noQwatNb+Df0ME2tHtOtx/5IR6kDWvvEDujz19CXmJ71po8zXMOZy2s0lG4nX\r\nx1mfgQG+WkzwuhbAN8mqfX+MT+zUg6bFvAcdB9j/3+IY5d8xl/BKqS6satx9\r\nEbx8fI5QtgXyFy6MrWX3yfHQbZccpve6g+VHPybimYipZy6i4z7RKjRVMQ2n\r\nLDrtKCu/O4TVUC/yRqOOWzbllIbxJqNhPVazcBa+GzMU7Ly5oVgZtma2yV3Y\r\nlYoEJ8DQNFypDjfW0cKruDhDyEDMXNcF2ZxlWlPKJ8XPPWkyTvH7IiSwzlYs\r\nclkRxwD95ioKiToL8hjcc8hA/UF6SjvEEJ4VoGfBOLLerzhnEgcbVvpQymbE\r\nt+uYPtkLGI/BiVqkbpY+XXabKiUfThVxhtVN4MnRE58L5+zPy62ZgBaB9xQl\r\n39R+hw2ydpZZWBx5P1d5WJKWLONTUchRihOhO9go6dLfFNKyS4ASqnzGENJb\r\nE2Y030o7XF0LRukmpppFX9TZusTZaeobV9myRs+MebrikjNMCCY7KMTcfSiT\r\nd9BA7XbbcR2cSPm60Jc2URaVSw2sNckbARk=\r\n=u/Yf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"adamfsk","email":"adamfsk@gmail.com"},"directories":{},"maintainers":[{"name":"adamfsk","email":"adamfsk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-webgl-canvas-mock_2.5.0_1683127678828_0.8176940212698158"},"_hasShrinkwrap":false},"2.5.2":{"name":"jest-webgl-canvas-mock","version":"2.5.2","description":"Mock both 2D and WebGL contexts in Jest.","main":"lib/index.js","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/"},"scripts":{"test":"jest --no-cache","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-jest":"^25.3.0","babel-plugin-version":"^0.2.3","coveralls":"^3.0.11","husky":"^4.2.5","jest":"^29.5.0","jest-environment-jsdom":"^29.5.0","jsdom":"^22.1.0","prettier":"^2.0.4"},"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"}},"jest":{"testEnvironment":"jsdom","collectCoverage":true,"collectCoverageFrom":["src/classes/**/*.js","src/mock/**/*.js"],"setupFiles":["@inrupt/jest-jsdom-polyfills","./src/index.js","./__mocks__/worker.js"]},"repository":{"type":"git","url":"git+https://github.com/adamfsk/jest-webgl-canvas-mock.git"},"keywords":["mock","jest","jest-mock","echarts","canvas","test","unit","stub","webgl","pixi","pixi.js","pixijs"],"author":{"name":"adamfsk"},"license":"MIT","bugs":{"url":"https://github.com/adamfsk/jest-webgl-canvas-mock/issues"},"homepage":"https://github.com/adamfsk/jest-webgl-canvas-mock#readme","_id":"jest-webgl-canvas-mock@2.5.2","gitHead":"ff2859725aee1c74b26df4e5632a283baf1650e5","_nodeVersion":"20.5.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-jvz+BqKYJncU97jyCJOSVEaMVN3ftADaAJortckK99Yzh2zqy739NLBqsgnMDvuqC69fm9am4vH14vUdQLrQMg==","shasum":"dbd02f2e06ae4541402b5b641e970821fd486eae","tarball":"https://registry.npmjs.org/jest-webgl-canvas-mock/-/jest-webgl-canvas-mock-2.5.2.tgz","fileCount":20,"unpackedSize":128797,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwVYPBbnghjqDGE+XrbVh3HyvI95zokDWazf7iBfT/uwIhAOSPnChCM4al55wHeRYZtvkHE8y6Qvs5zOp6mW9eDLrl"}]},"_npmUser":{"name":"adamfsk","email":"adamfsk@gmail.com"},"directories":{},"maintainers":[{"name":"adamfsk","email":"adamfsk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-webgl-canvas-mock_2.5.2_1698675531559_0.9611678315957397"},"_hasShrinkwrap":false,"deprecated":"Bug discovered. Will be updated after fix."},"2.5.3":{"name":"jest-webgl-canvas-mock","version":"2.5.3","description":"Mock both 2D and WebGL contexts in Jest.","main":"lib/index.js","types":"types/index.d.ts","publishConfig":{"registry":"https://registry.npmjs.org/"},"scripts":{"test":"jest --no-cache","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-jest":"^25.3.0","babel-plugin-version":"^0.2.3","coveralls":"^3.0.11","husky":"^4.2.5","jest":"^29.5.0","jest-environment-jsdom":"^29.5.0","jsdom":"^22.1.0","prettier":"^2.0.4"},"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"}},"jest":{"testEnvironment":"jsdom","collectCoverage":true,"collectCoverageFrom":["src/classes/**/*.js","src/mock/**/*.js"],"setupFiles":["@inrupt/jest-jsdom-polyfills","./src/index.js","./__mocks__/worker.js"]},"repository":{"type":"git","url":"git+https://github.com/adamfsk/jest-webgl-canvas-mock.git"},"keywords":["mock","jest","jest-mock","echarts","canvas","test","unit","stub","webgl","pixi","pixi.js","pixijs"],"author":{"name":"adamfsk"},"license":"MIT","bugs":{"url":"https://github.com/adamfsk/jest-webgl-canvas-mock/issues"},"homepage":"https://github.com/adamfsk/jest-webgl-canvas-mock#readme","_id":"jest-webgl-canvas-mock@2.5.3","gitHead":"a51f40ec091a723d3b10b725db0311a8bb4cf43f","_nodeVersion":"20.5.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-aE5ym/VV8hpJgsu/zzmvJ/bhD4vnfAM9TY6TRQxQAy9lo3hxtNfa2rbLFt3Qx31spQd5fhlQHO58Aey6oFDxAA==","shasum":"22f6c6b27ccb54a0fa49ae24dfdaf144d211ffc7","tarball":"https://registry.npmjs.org/jest-webgl-canvas-mock/-/jest-webgl-canvas-mock-2.5.3.tgz","fileCount":20,"unpackedSize":128860,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCVWvloV00I8BsNA6edvM9daQPEfysMWsKsPbARYuUelAIgT/k5NUHs3qOb4EAzftyGEKQ8R9V2L49vKVwN2j8GRKU="}]},"_npmUser":{"name":"adamfsk","email":"adamfsk@gmail.com"},"directories":{},"maintainers":[{"name":"adamfsk","email":"adamfsk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jest-webgl-canvas-mock_2.5.3_1698682195830_0.8557378786432663"},"_hasShrinkwrap":false}},"maintainers":[{"name":"adamfsk","email":"adamfsk@gmail.com"}],"description":"Mock both 2D and WebGL contexts in Jest.","homepage":"https://github.com/adamfsk/jest-webgl-canvas-mock#readme","keywords":["mock","jest","jest-mock","echarts","canvas","test","unit","stub","webgl","pixi","pixi.js","pixijs"],"repository":{"type":"git","url":"git+https://github.com/adamfsk/jest-webgl-canvas-mock.git"},"author":{"name":"adamfsk"},"bugs":{"url":"https://github.com/adamfsk/jest-webgl-canvas-mock/issues"},"license":"MIT","readme":"# jest-webgl-canvas-mock\n\n> Mock `canvas` and `WebGL` when run unit test cases with jest. For more browser environment, you can use [jest-electron](https://github.com/hustcc/jest-electron) for real browser runtime.\n\n[![Build Status](https://github.com/adamfsk/jest-webgl-canvas-mock/workflows/build/badge.svg)](https://github.com/adamfsk/jest-webgl-canvas-mock/actions/workflows/build.yml)\n[![npm](https://img.shields.io/npm/v/jest-webgl-canvas-mock.svg)](https://www.npmjs.com/package/jest-webgl-canvas-mock)\n[![npm](https://img.shields.io/npm/dm/jest-webgl-canvas-mock.svg)](https://www.npmjs.com/package/jest-webgl-canvas-mock)\n\n## Disclaimer\n\nThis project is a simple merge of [jest-canvas-mock](https://github.com/hustcc/jest-canvas-mock) with\n[webgl-mock](https://github.com/kbirk/webgl-mock) so that both 2d and webgl contexts can be tested in jest.\nAs 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 jest.\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 --save-dev jest-webgl-canvas-mock\n```\n\n## Setup\n\nIn your `package.json` under the `jest`, create a `setupFiles` array and add `jest-webgl-canvas-mock` to the array.\n\n```json\n{\n  \"jest\": {\n    \"setupFiles\": [\"jest-webgl-canvas-mock\"]\n  }\n}\n```\n\nIf you already have a `setupFiles` attribute you can also append `jest-webgl-canvas-mock` to the array.\n\n```json\n{\n  \"jest\": {\n    \"setupFiles\": [\"./__setups__/other.js\", \"jest-webgl-canvas-mock\"]\n  }\n}\n```\n\nMore about in [configuration section](https://facebook.github.io/jest/docs/en/configuration.html#content).\n\n## Setup file\n\nAlternatively you can create a new setup file which then requires this module or\nadd the `require` statement to an existing setup file.\n\n`__setups__/canvas.js`\n\n```js\nimport 'jest-webgl-canvas-mock';\n// or\nrequire('jest-webgl-canvas-mock');\n```\n\nAdd that file to your `setupFiles` array:\n\n```json\n\"jest\": {\n  \"setupFiles\": [\n    \"./__setups__/canvas.js\"\n  ]\n}\n```\n\n## Reset\n\nIf you reset the jest mocks (for example, with `jest.resetAllMocks()`), you can\ncall `setupJestCanvasMock()` to re-create it.\n\n```\nimport { setupJestCanvasMock } from 'jest-webgl-canvas-mock';\n\nbeforeEach(() => {\n  jest.resetAllMocks();\n  setupJestCanvasMock();\n});\n```\n\n## Mock Strategy\n\nThis mock strategy implements all the canvas functions and actually verifies the parameters. If a\nknown condition would cause the browser to throw a `TypeError` or a `DOMException`, it emulates the\nerror. For instance, the `CanvasRenderingContext2D#arc` function will throw a `TypeError` if the\nradius is negative, or if it was not provided with enough parameters.\n\n```ts\n// arc throws a TypeError when the argument length is less than 5\nexpect(() => ctx.arc(1, 2, 3, 4)).toThrow(TypeError);\n\n// when radius is negative, arc throws a dom exception when all parameters are finite\nexpect(() => ctx.arc(0, 0, -10, 0, Math.PI * 2)).toThrow(DOMException);\n```\n\nThe function will do `Number` type coercion and verify the inputs exactly like the browser does. So\nthis is valid input.\n\n```ts\nexpect(() => ctx.arc('10', '10', '20', '0', '6.14')).not.toThrow();\n```\n\nAnother part of the strategy is to validate input types. When using the\n`CanvasRenderingContext2D#fill` function, if you pass it an invalid `fillRule` it will throw a\n`TypeError` just like the browser does.\n\n```ts\nexpect(() => ctx.fill('invalid!')).toThrow(TypeError);\nexpect(() => ctx.fill(new Path2D(), 'invalid!')).toThrow(TypeError);\n```\n\nWe try to follow the ECMAScript specification as closely as possible.\n\n## Snapshots\n\nThere are multiple ways to validate canvas state using snapshots. There are currently three methods\nattached to the `CanvasRenderingContext2D` class. The first way to use this feature is by using the\n`__getEvents` method.\n\n```ts\n/**\n * In order to see which functions and properties were used for the test, you can use `__getEvents`\n * to gather this information.\n */\nconst events = ctx.__getEvents();\n\nexpect(events).toMatchSnapshot(); // jest will assert the events match the snapshot\n```\n\nThe second way is to inspect the current path associated with the context.\n\n```ts\nctx.beginPath();\nctx.arc(1, 2, 3, 4, 5);\nctx.moveTo(6, 7);\nctx.rect(6, 7, 8, 9);\nctx.closePath();\n\n/**\n * Any method that modifies the current path (and subpath) will be pushed to an event array. When\n * using the `__getPath` method, that array will sliced and usable for snapshots.\n */\nconst path = ctx.__getPath();\nexpect(path).toMatchSnapshot();\n```\n\nThe third way is to inspect all of the successful draw calls submitted to the context.\n\n```ts\nctx.drawImage(img, 0, 0);\n\n/**\n * Every drawImage, fill, stroke, fillText, or strokeText function call will be logged in an event\n * array. This method will return those events here for inspection.\n */\nconst calls = ctx.__getDrawCalls();\nexpect(calls).toMatchSnapshot();\n```\n\nIn some cases it may be useful to clear the events or draw calls that have already been logged.\n\n```ts\n// Clear events\nctx.__clearEvents();\n\n// Clear draw calls\nctx.__clearDrawCalls();\n```\n\nFinally, it's possible to inspect the clipping region calls by using the `__getClippingRegion`\nfunction.\n\n```ts\nconst clippingRegion = ctx.__getClippingRegion();\nexpect(clippingRegion).toMatchSnapshot();\n```\n\nThe clipping region cannot be cleared because it's based on the stack values and when the `.clip()`\nfunction is called.\n\n## Override default mock return value\n\nYou can override the default mock return value in your test to suit your need. For example, to override return value of `toDataURL`:\n\n```ts\ncanvas.toDataURL.mockReturnValueOnce(\n  'data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='\n);\n```\n\n## Contributors\n\n- [@hustcc](https://github.com/hustcc)\n- [@jtenner](https://github.com/jtenner)\n- [@evanoc0](https://github.com/evanoc0)\n- [@lekha](https://github.com/lekha)\n- [@yonatankra](https://github.com/yonatankra)\n- [@LitoMore](https://github.com/LitoMore)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}