{"id":15451793,"url":"https://github.com/willscott/grunt-jasmine-firefoxaddon","last_synced_at":"2026-04-30T10:37:08.409Z","repository":{"id":27105239,"uuid":"30572772","full_name":"willscott/grunt-jasmine-firefoxaddon","owner":"willscott","description":"Run jasmine specs in a Firefox addon","archived":false,"fork":false,"pushed_at":"2016-04-11T18:03:46.000Z","size":122,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-22T05:31:49.033Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willscott.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-10T03:24:21.000Z","updated_at":"2016-02-03T19:54:47.000Z","dependencies_parsed_at":"2022-09-04T13:01:53.978Z","dependency_job_id":null,"html_url":"https://github.com/willscott/grunt-jasmine-firefoxaddon","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/willscott/grunt-jasmine-firefoxaddon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgrunt-jasmine-firefoxaddon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgrunt-jasmine-firefoxaddon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgrunt-jasmine-firefoxaddon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgrunt-jasmine-firefoxaddon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willscott","download_url":"https://codeload.github.com/willscott/grunt-jasmine-firefoxaddon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willscott%2Fgrunt-jasmine-firefoxaddon/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32462304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-01T21:39:25.488Z","updated_at":"2026-04-30T10:37:08.394Z","avatar_url":"https://github.com/willscott.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-jasmine-firefoxaddon\n\n\u003e Run jasmine specs in a Firefox Addon\n\n\nGetting Started\n---------------\n\nThis plugin requires Grunt ```^0.4.5```\n\nIf you haven't used Grunt before, be sure to check out the Getting Started\nguide, which explains how to create your grunt file. Once you're familiar with\nthe process, this plugin can be installed as:\n\n```shell\nnpm install grunt-jasmine-firefoxaddon --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled with this line of\nJavaScript:\n```javascript\ngrunt.loadNpmTasks('grunt-jasmine-firefoxaddon');\n```\n\nJasmine Task\n------------\n\nRun this task with the ```grunt jasmine_firefoxaddon``` command.\n\nAutomatically builds and maintains the spec runner and reports results back to\nthe grunt console. Uses jpm provided by mozilla to run a dynamically constructed\nfirefox addon that runs jasmine specs by using browserify. Allows for copying\nand loading of custom `.jsm` files. The addon is built in the `.build/` path,\nbut is deleted after the task successfully completes. If the task fails part\nway it will likely remain, and may be useful for debugging.\n\nNote that if your addon needs to access other resources, you will need to make\nthe files available (e.g. with\n[grunt-contrib-copy](https://www.npmjs.com/package/grunt-contrib-copy)) under\nthe path `.build/data/...` and then access them in your addon with the path\n`resource://grunt-jasmine-firefoxaddon-runner/data/...` (you can also use\n`self.data.url(...)` if\n[the self API](https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/self)\nis available to you). This is due to the structure of Firefox addons - future\niterations of this tool may be able to make the process smoother.\n\n\nCustomize your SpecRunner\n-------------------------\n\nUse your own files in the app to customize your tests. For all of the below, you\ncan use [node globbing patterns](https://github.com/isaacs/node-glob).\n\n### Options\n\n#### tests\nType: `String|Array`\n\nThe spec files you want to run.\n\n#### resources\nType: `String|Array`\n\nResources (.js, .json, etc.) needed for the tests (will be made available to the\naddon under `data/`, but *not* automatically loaded into the addon - your tests\ncan pull them in as needed from\n`resource://grunt-jasmine-firefoxaddon-runner/data/`). These files *can* be\n`.jsm`, which would allow them to be loaded via `Components.utils.import`, or\nthey can be of other types (which will require different mechanisms to load,\ncurrently left as an exercise to the user - future updates to this tool may try\nto facilitate common use cases).\n\n#### helpers\nType: `String|Array`\n\nCustom JavaScript module (`.jsm`) files you wish you load into your addon during\ntest. These files *are* automatically loaded during addon setup, but *must* be\n`.jsm` types (JavaScript with an `EXPORTED_SYMBOLS` array to define visibility).\n\n#### options.timeout\nType: `Number`\nDefault: `10000`\n\nHow many milliseconds to wait for the browser to start up before failing.\n\n\n### Issues/debugging\n\nIdeally this runner should \"just work\" with your tests - however, if it doesn't\nhere are a few common issues and suggested approaches:\n\n- The path where resources are (`grunt-jasmine-firefoxaddon-runner/data/...`)\nmay conflict with the path you need to specify if you run your tests in other\nenvironments. In that case, you can put logic to set the Firefox-addon-specific\npath in a block like `if (typeof window === 'undefined') { path = ... }` - this\nassumes that `window` is defined in your other relevant environments (it isn't\nwithin the scope of a Firefox addon).\n- If you're using [freedom.js](https://github.com/freedomjs/freedom) you need\nto ensure that your module actually loads and does something (e.g. emits a\nmessage from the WebWorker to the \"front-end\"). If it doesn't then the test\nrunner may terminate prematurely and give fairly uninformative error messages\nlike \"error loading resource\" (referring usually to some part of the freedom\nmodule). [This is an example of a minimal working freedom.js module]\n(https://github.com/trevj/grunt-jasmine-firefoxaddon-test/) for this runner.\n\nIf you encounter some other problem then feel free to file an issue in this\nGitHub repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillscott%2Fgrunt-jasmine-firefoxaddon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillscott%2Fgrunt-jasmine-firefoxaddon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillscott%2Fgrunt-jasmine-firefoxaddon/lists"}