{"_id":"@anshulsanghi/googlemaps-vitest-mocks","_rev":"1-19aa92d1bf307f2d3d73a5ab0f122b69","name":"@anshulsanghi/googlemaps-vitest-mocks","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@anshulsanghi/googlemaps-vitest-mocks","version":"1.0.0","keywords":["google","maps","vitest"],"homepage":"https://github.com/anshap1719/js-vitest-mocks","bugs":{"url":"https://github.com/anshap1719/js-vitest-mocks/issues"},"repository":{"type":"git","url":"git+https://github.com/anshap1719/js-vitest-mocks.git"},"license":"Apache-2.0","author":{"name":"Anshul Sanghi"},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"docs":"typedoc src/index.ts","format":"eslint . --fix","lint":"eslint .","prepare":"rm -rf dist && rollup -c","test":"vitest run src/*","test:watch":"vitest --watch src/*"},"devDependencies":{"@rollup/plugin-typescript":"^8.4.0","@types/google.maps":"^3.49.1","@types/node":"^18.7.14","@typescript-eslint/eslint-plugin":">=4.33.0","@typescript-eslint/parser":">=4.33.0","eslint":"^7.32.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","prettier":"^2.7.1","rollup":"^2.78.1","typedoc":"^0.23.11","typescript":"^4.7.4","vitest":"^0.22.1"},"publishConfig":{"access":"public"},"gitHead":"c3c3de75289656c65659c49f00c930cbcee8e30f","description":"[![npm](https://img.shields.io/npm/v/@anshulsanghi/googlemaps-vitest-mocks)](https://www.npmjs.com/package/@anshulsanghi/googlemaps-vitest-mocks) ![Build](https://github.com/anshap1719/js-vitest-mocks/workflows/Test/badge.svg) ![Release](https://github.co","_id":"@anshulsanghi/googlemaps-vitest-mocks@1.0.0","_nodeVersion":"17.3.1","_npmVersion":"8.17.0","dist":{"integrity":"sha512-nJwhHSbVUZf1zJ/Ne+ZltRHj+7d8sV8+TIiUGgoOX9do7b2xiic7PKICyEGwhJYK049mUtODOwS0XE+kdTLdcA==","shasum":"733b6c56fd4fc1a2d4efdbd7515ac2a16aa58d64","tarball":"https://registry.npmjs.org/@anshulsanghi/googlemaps-vitest-mocks/-/googlemaps-vitest-mocks-1.0.0.tgz","fileCount":49,"unpackedSize":117172,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICU1QisTMYZ1kRJYXPzrxaARKwZvXD/Y6wRABgCrOiHfAiA6tblgLLHjzHiFUz1F60P3qnd8rDqLCxucrt7IVuCOxg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEd2LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp6LA//WwPN4k72Z95XHQ6ssmHCfvOBEk68/jXf+jYybp+GoWJH98Sr\r\nGScgWkLb35zILMMitf53mUWRWYG2J5hqMQwDKApYPUdZLZkGYMJIQgm+qpRk\r\n45CPgTGPMG4Zme/gtKnWBnOET49RVafx19ZcIuZKE0Fjg46d0IqbfMu1ZqbD\r\nPHfhVXEMD7aAE+dKOylrYh9zf/EHFsp/4eQHmkkaoVasTwdUAagMBWO8mj2F\r\n+o1hPQ6uaE6qazXcVFix8S3LZqmiYftU4REkqMvYMBouXtSd8Suvl3TdIZ17\r\np6I4F2BKmZTXld7cFMFW4fssCwVBNkArrFyieRSTsjm7Xc2ooitwOOriOUM2\r\n6u9rOBeulIQXqdvcrgZiZyS24NmnDVlOZcXC7nqiaKWFP3zobROu4oIvSC6q\r\nb7DU2fO3T0QlH/F9ujMJvPPov5Jwct2v/dony1sgDNgC1l3ojFMtgbqicRYA\r\nEoalf01YvV62ZBzE2JyAVjzsV7C48aoi44CFGWYuIOJHooDQ8JpLVXXtwpOI\r\n+rwW6+OoQAeHjMKCetk/IcCkQ01jnLZWpbuUE7uOHw0AlxCf11s8Rn+6OYW8\r\nT8ms2Pmrw1nFWvCptLWql835zr4/atYpgPMzbn9mgFUvlprcLtFBTZcsqhDD\r\nu5JbNfD5eV2aS1vyh8SATBYnYE5hi1gIRLA=\r\n=MTh1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"anshulsanghi","email":"anshul@anshulsanghi.tech"},"directories":{},"maintainers":[{"name":"anshulsanghi","email":"anshul@anshulsanghi.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/googlemaps-vitest-mocks_1.0.0_1662115211347_0.0943810585055136"},"_hasShrinkwrap":false},"1.0.1":{"name":"@anshulsanghi/googlemaps-vitest-mocks","version":"1.0.1","keywords":["google","maps","vitest"],"homepage":"https://github.com/anshap1719/js-vitest-mocks","bugs":{"url":"https://github.com/anshap1719/js-vitest-mocks/issues"},"repository":{"type":"git","url":"git+https://github.com/anshap1719/js-vitest-mocks.git"},"license":"Apache-2.0","author":{"name":"Anshul Sanghi"},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"docs":"typedoc src/index.ts","format":"eslint . --fix","lint":"eslint .","prepare":"rm -rf dist && rollup -c","test":"vitest run src/*","test:watch":"vitest --watch src/*"},"devDependencies":{"@rollup/plugin-typescript":"^8.4.0","@types/google.maps":"^3.49.1","@types/node":"^18.7.14","@typescript-eslint/eslint-plugin":">=4.33.0","@typescript-eslint/parser":">=4.33.0","@vitest/coverage-istanbul":"^0.22.1","eslint":"^7.32.0","eslint-config-prettier":"^8.5.0","eslint-plugin-prettier":"^4.2.1","prettier":"^2.7.1","rollup":"^2.78.1","typedoc":"^0.23.11","typescript":"^4.7.4","vitest":"^0.22.1"},"publishConfig":{"access":"public"},"gitHead":"8e40147232084173a0fb5f04768ddd1f0f69738b","description":"## Forked from https://github.com/googlemaps/js-jest-mocks","_id":"@anshulsanghi/googlemaps-vitest-mocks@1.0.1","_nodeVersion":"17.3.1","_npmVersion":"8.17.0","dist":{"integrity":"sha512-VKHRmsrHuMkQSZDmoB3txrLiy6Bjhv8cRdYKqBerOkSt2WoZWy3dDO3DwUmaaD0oslrt1a+TCdPABUERotzYmg==","shasum":"8830efc3b4e38f2be9ff15f63a1b0f8ccde8b012","tarball":"https://registry.npmjs.org/@anshulsanghi/googlemaps-vitest-mocks/-/googlemaps-vitest-mocks-1.0.1.tgz","fileCount":49,"unpackedSize":117276,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCl+0qaz95bI9m6tFtRoDJ/qMXAusDpVmN7UTyP3vJRRQIgChibNK47+YZVnWiuk/Ydzm+yfmAplYHMVBpoUc7Y9bE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEeAuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVHhAAgu1212UK+JknWECi7yhsHjeGtJoLWPL9vdTztXuaFdVjwxRL\r\nYb3QaZpZY4cVXRlpOXsL8I0qAl4dxcg0Ar/CKPIsck/9WONI3a0rnN8zyLD+\r\nsnFUQzabmUba2QyyQo/KaYGYavSByE0uMQqzbn66T/Z2VP/zon1z6p2EO95R\r\nTBlFaTWPvtfqVQ7wHsOgvJih1mHbNhoJJKAw5m4b0af8M0WDp45xOrnVfRHF\r\nlG9/falu4Z6pl7heEz5RMV5Jlt02QNLW79uJsxhXM5gDxIeklamG/POpZjTU\r\nQIPeOedainrwsudt3WP3/ZOjKdx+XnDflWJx9PpMOQgz1Ow57E8arqvYPPYs\r\nvVFqs8xPcpDISvhI3XduQuRXmpo4JT9JjTf/KkhFrT0D922WFsXdT2q+APmg\r\ngwvQL+phPNcnsqCkVf90CkYvMLMsRLBZSVgwGjtuLKKOpH+uegMfTAVzT8Mi\r\nbGAcZoXaNq6LP8PgzDd3VPktuokZFb9iLeXdgDNOsNvULuqsvzYMS6a52NJR\r\nJVIG0rn+AAwlUaj+6WOQ/f3IvbZN2cNJl334ejhxkzgLQS2xYYkZUfGWD2kI\r\nzqtSkgWmzOMAnh7DuI550RtvV99T11N328EMZztmGqTIZ3YFemL2RqbZCMWO\r\nPXUd49j0BQ6fiWQjGVmZ9n7V0QH+C4lfUaw=\r\n=vzW9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"anshulsanghi","email":"anshul@anshulsanghi.tech"},"directories":{},"maintainers":[{"name":"anshulsanghi","email":"anshul@anshulsanghi.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/googlemaps-vitest-mocks_1.0.1_1662115886655_0.5113968860100129"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-02T10:40:11.305Z","1.0.0":"2022-09-02T10:40:11.559Z","modified":"2022-09-02T10:51:26.949Z","1.0.1":"2022-09-02T10:51:26.873Z"},"maintainers":[{"name":"anshulsanghi","email":"anshul@anshulsanghi.tech"}],"description":"## Forked from https://github.com/googlemaps/js-jest-mocks","homepage":"https://github.com/anshap1719/js-vitest-mocks","keywords":["google","maps","vitest"],"repository":{"type":"git","url":"git+https://github.com/anshap1719/js-vitest-mocks.git"},"author":{"name":"Anshul Sanghi"},"bugs":{"url":"https://github.com/anshap1719/js-vitest-mocks/issues"},"license":"Apache-2.0","readme":"# Vitest Mocks for Google Maps\n\n## Forked from https://github.com/googlemaps/js-jest-mocks\n\n[![npm](https://img.shields.io/npm/v/@anshulsanghi/googlemaps-vitest-mocks)](https://www.npmjs.com/package/@anshulsanghi/googlemaps-vitest-mocks)\n![Build](https://github.com/anshap1719/js-vitest-mocks/workflows/Test/badge.svg)\n![Release](https://github.com/anshap1719/js-vitest-mocks/workflows/Release/badge.svg)\n[![codecov](https://codecov.io/gh/anshap1719/js-vitest-mocks/branch/main/graph/badge.svg)](https://codecov.io/gh/anshap1719/js-vitest-mocks)\n![GitHub contributors](https://img.shields.io/github/contributors/anshap1719/js-vitest-mocks?color=green)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![](https://github.com/jpoehnelt/in-solidarity-bot/raw/main/static//badge-flat.png)](https://github.com/apps/in-solidarity)\n[![Discord](https://img.shields.io/discord/676948200904589322?color=6A7EC2&logo=discord&logoColor=ffffff)](https://discord.gg/jRteCzP)\n\n## Description\n\nVitest mocks for Google Maps in TypeScript.\n\n**Note:** If you find a missing mock, please open an [issue][issues].\n\n## NPM\n\nAvailable via NPM as the package `@anshulsanghi/googlemaps-vitest-mocks`\n\n## Inspecting mocks\n\nYou can inspect what happens with the created mock instances (e.g. `Map` or `Marker`) via the `mockInstances` object.\n\n```ts\nimport {\n  initialize,\n  Map,\n  Marker,\n  mockInstances,\n} from \"@anshulsanghi/googlemaps-vitest-mocks\";\n\nbeforeEach(() => {\n  initialize();\n});\n\ntest(\"my test\", () => {\n  const map = new google.maps.Map(null);\n  const markerOne = new google.maps.Marker();\n  const markerTwo = new google.maps.Marker();\n\n  map.setHeading(8);\n  markerOne.setMap(map);\n  markerTwo.setLabel(\"My marker\");\n\n  const mapMocks = mockInstances.get(Map);\n  const markerMocks = mockInstances.get(Marker);\n\n  expect(mapMocks).toHaveLength(1);\n  expect(markerMocks).toHaveLength(2);\n  expect(mapMocks[0].setHeading).toHaveBeenCalledWith(8);\n  expect(markerMocks[0].setMap).toHaveBeenCalledTimes(1);\n  expect(markerMocks[1].setLabel).toHaveBeenCalledWith(\"My marker\");\n});\n```\n\n## Cleaning up mocks\n\nWhenever `initialize()` is called, the captured mocks are automatically cleaned. Using any of Vitest's methods, you can clean the mock instances at any time:\n\n```ts\nimport {\n  initialize,\n  Map,\n  Marker,\n  mockInstances,\n} from \"@anshulsanghi/googlemaps-vitest-mocks\";\n\nbeforeAll(() => {\n  initialize();\n});\n\n// Clear all mocks\nbeforeEach(() => {\n  mockInstances.clearAll();\n});\n\n// Clear specific mocks\nbeforeEach(() => {\n  mockInstances.clear(Map, Marker);\n});\n```\n\n## Support\n\nThis library is community supported. We're comfortable enough with the stability and features of\nthe library that we want you to build real production applications on it.\n\nIf you find a bug, or have a feature suggestion, please [log an issue][issues]. If you'd like to\ncontribute, please read [How to Contribute][contrib].\n\n[issues]: https://github.com/anshap1719/js-vitest-mocks/issues\n[contrib]: CONTRIBUTING.md\n","readmeFilename":"README.md"}