{"id":14967448,"url":"https://github.com/andreaspizsa/setup-browser-env","last_synced_at":"2025-04-04T10:58:31.924Z","repository":{"id":76025517,"uuid":"157974490","full_name":"AndreasPizsa/setup-browser-env","owner":"AndreasPizsa","description":"✅ Simplified browser testing in node.","archived":false,"fork":false,"pushed_at":"2020-06-03T09:19:58.000Z","size":2735,"stargazers_count":1,"open_issues_count":10,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T00:18:03.483Z","etag":null,"topics":["ava","ava-tests","browser-testing","browser-tests","mocha","mocha-tests","mochajs","node-js","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndreasPizsa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-17T10:39:45.000Z","updated_at":"2019-03-05T21:34:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb9865cf-e0ed-415c-a941-618e203596d6","html_url":"https://github.com/AndreasPizsa/setup-browser-env","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreasPizsa%2Fsetup-browser-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreasPizsa%2Fsetup-browser-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreasPizsa%2Fsetup-browser-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndreasPizsa%2Fsetup-browser-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndreasPizsa","download_url":"https://codeload.github.com/AndreasPizsa/setup-browser-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166157,"owners_count":20894652,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ava","ava-tests","browser-testing","browser-tests","mocha","mocha-tests","mochajs","node-js","nodejs"],"created_at":"2024-09-24T13:38:04.546Z","updated_at":"2025-04-04T10:58:31.892Z","avatar_url":"https://github.com/AndreasPizsa.png","language":"JavaScript","readme":"# `setup-browser-env`\n\n[![postinstaller](https://postinstaller-badge.now.sh/postinstaller?style=flat-square)](https://github.com/postinstaller/postinstaller) [![build](https://img.shields.io/travis/AndreasPizsa/setup-browser-env.svg?style=flat-square)](https://travis-ci.org/AndreasPizsa/setup-browser-env) [![coverage](https://img.shields.io/coveralls/github/AndreasPizsa/setup-browser-env.svg?style=flat-square)](https://coveralls.io/github/AndreasPizsa/setup-browser-env) ![license](https://img.shields.io/github/license/AndreasPizsa/setup-browser-env.svg?style=flat-square) [![version](https://img.shields.io/npm/v/setup-browser-env.svg?style=flat-square)](https://www.npmjs.com/package/setup-browser-env) [![downloads](https://img.shields.io/npm/dm/setup-browser-env.svg?style=flat-square)](https://www.npmjs.com/package/setup-browser-env)\n\n\u003e Simplifies simulating a global browser environment using [browser-env][].\n\n# Motivation\n\n`setup-browser-env` simplifies simulating a global browser environment using [browser-env][] with zero configuration, keeping your project structure lean, clean \u0026 organized.\n\n# Features\n\n+   ✅ **Compatible.** Works with [ava][], [mocha][] and everything else.\n+   ✅ **Zero Configuration** for ava. `npm add`, done.\n+   ✅ **Configurable.** via `package.json` or `browser-env.{js, json, yaml}`\n+   ✅ **Reliable.** 100% Code Coverage.\n+   ✅ **Free.** MIT License.\n\n# Usage\n\n## Install\n\n```sh\nnpm add -D setup-browser-env\n```\n\n### ava\n\n##### Automatic configuration\n\nIf you’re using `ava` as a `devDependency`, installing `setup-browser-env` will configure ava automatically (using [postinstaller](http://github.com/postinstaller/postinstaller)).\n\n\n##### Manual configuration\n\n```json\n// package.json\n{\n  \"ava\": {\n    \"require\": [\n      \"setup-browser-env\"\n    ]\n  }\n}\n```\n\n### mocha\n\n##### Manual configuration\n\n```js\n# mocha.opts\n--require setup-browser-env\n```\n\n## Advanced Configuration\n\n`setup-browser-env` runs out of the box without further configuration. You can still set options if needed in your `package.json` or a  `browser-env.{js,json,yaml}` config file.\n\nTo learn about all configuration options, please see [browser-env][] and [jsdom][].\n\n#### package.json\n\n```\n{\n  \"browser-env\": {\n    \"globals\": [\"window\", \"document\"],\n    \"jsdom\": {\n      \"userAgent\": \"My User Agent\"\n    }\n  }\n}\n```\n\n#### Shortcuts\n\nPass only the of name global properties without setting jsdom options:\n\n```\n{\n  \"browser-env\": \"window document\"\n}\n```\n\n```\n{\n  \"browser-env\": [\"window\", \"document\"]\n}\n```\n\nPass only jsdom options without setting the of name global properties:\n\n```\n{\n  \"browser-env\": {\n    \"userAgent\": \"My User Agent\"\n  }\n}\n```\n\n[ava]: https://github.com/avajs/ava\n[mocha]: https://mochajs.org\n[jsdom]: https://www.npmjs.com/package/jsdom\n[browser-env]: https://www.npmjs.com/package/browser-env\n[Andreas Pizsa]: https://twitter.com/AndreasPizsa\n[license]: LICENSE.md\n\n---\n\nCopyright © 2018 [Andreas Pizsa][]. Licensed under the MIT [license][].\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaspizsa%2Fsetup-browser-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreaspizsa%2Fsetup-browser-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaspizsa%2Fsetup-browser-env/lists"}