{"id":17483421,"url":"https://github.com/gruntjs/grunt-contrib-jasmine","last_synced_at":"2025-05-14T06:13:11.647Z","repository":{"id":5308725,"uuid":"6490427","full_name":"gruntjs/grunt-contrib-jasmine","owner":"gruntjs","description":"Run jasmine specs headlessly through Headless Chrome","archived":false,"fork":false,"pushed_at":"2024-11-23T01:32:42.000Z","size":3534,"stargazers_count":353,"open_issues_count":10,"forks_count":197,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-03-16T05:32:38.928Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"http://gruntjs.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"moodleuulm/moodle-availability_password","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gruntjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-11-01T13:50:37.000Z","updated_at":"2025-01-02T01:09:37.000Z","dependencies_parsed_at":"2024-04-19T20:50:04.627Z","dependency_job_id":"17a9bfcb-97a8-4830-b482-9ae11b5a46b0","html_url":"https://github.com/gruntjs/grunt-contrib-jasmine","commit_stats":{"total_commits":300,"total_committers":79,"mean_commits":"3.7974683544303796","dds":0.8633333333333333,"last_synced_commit":"af4ac40c5471e3ffa0ab3c1f02d4b3d9afd5155d"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-jasmine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-jasmine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-jasmine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruntjs%2Fgrunt-contrib-jasmine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gruntjs","download_url":"https://codeload.github.com/gruntjs/grunt-contrib-jasmine/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830918,"owners_count":20354849,"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":["hacktoberfest"],"created_at":"2024-10-19T00:04:57.230Z","updated_at":"2025-03-20T13:11:28.968Z","avatar_url":"https://github.com/gruntjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grunt-contrib-jasmine v4.0.0 [![Build Status](https://github.com/gruntjs/grunt-contrib-jasmine/workflows/Tests/badge.svg)](https://github.com/gruntjs/grunt-contrib-jasmine/actions?workflow=Tests)\n\n\u003e Run jasmine specs headlessly through Headless Chrome\n\n\n\n## Getting Started\n\nIf you haven't used [Grunt](https://gruntjs.com/) before, be sure to check out the [Getting Started](https://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](https://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\n\n```shell\nnpm install grunt-contrib-jasmine --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-contrib-jasmine');\n```\n\n\n\n\n## Jasmine task\n_Run this task with the `grunt jasmine` command._\n\nAutomatically builds and maintains your spec runner and runs your tests headlessly through Headless Chrome.\n\n#### Run specs locally or on a remote server\n\nRun your tests on your local filesystem or via a server task like [grunt-contrib-connect][].\n\n#### Customize your SpecRunner with templates\n\nUse your own SpecRunner templates to customize how `grunt-contrib-jasmine` builds the SpecRunner. See the\n[wiki](https://github.com/gruntjs/grunt-contrib-jasmine/wiki/Jasmine-Templates) for details and third party templates for examples.\n\n##### AMD Support\n\nSupports AMD tests via the [grunt-template-jasmine-requirejs](https://github.com/jsoverson/grunt-template-jasmine-requirejs) module\n\n##### Third party templates\n\n- [RequireJS](https://github.com/jsoverson/grunt-template-jasmine-requirejs)\n- [Code coverage output with Istanbul](https://github.com/maenu/grunt-template-jasmine-istanbul)\n- [StealJS](https://github.com/jaredstehler/grunt-template-jasmine-steal)\n\n[grunt-contrib-connect]: https://github.com/gruntjs/grunt-contrib-connect\n\n### Options\n\n#### src\nType: `String|Array`\n\nYour source files. These are the files that you are testing. If you are using RequireJS your source files will be loaded as dependencies into your spec modules and will not need to be placed here.\n\n#### options.specs\nType: `String|Array`\n\nYour Jasmine specs.\n\n#### options.vendor\nType: `String|Array`\n\nThird party libraries like jQuery \u0026 generally anything loaded before source, specs, and helpers.\n\n#### options.helpers\nType: `String|Array`\n\nNon-source, non-spec helper files. In the default runner these are loaded after `vendor` files\n\n#### options.styles\nType: `String|Array`\n\nCSS files that get loaded after the jasmine.css\n\n#### options.version\nType: `String`\nDefault: `'latest'`\n\nThis is the version of Jasmine which will be used. Available versions are [published to npm](https://www.npmjs.com/package/jasmine-core?activeTab=versions).\n\n#### options.tempDir\nType: `String`\nDefault: `.grunt/grunt-contrib-jasmine`\n\nThe temporary directory that runners use to load jasmine files.\nAutomatically deleted upon normal runs.\n\n#### options.outfile\nType: `String`  \nDefault: `_SpecRunner.html`\n\nThe auto-generated specfile that Headless Chrome will use to run your tests.\nAutomatically deleted upon normal runs. Use the `:build` flag to generate a SpecRunner manually e.g.\n`grunt jasmine:myTask:build`\n\n#### options.keepRunner\nType: `Boolean`  \nDefault: `false`  \n\nPrevents the auto-generated specfile used to run your tests from being automatically deleted.\n\n#### options.junit.path\nType: `String`  \nDefault: `undefined`\n\nPath to output JUnit xml\n\n#### options.junit.consolidate\nType: `Boolean`  \nDefault: `false`\n\nConsolidate the JUnit XML so that there is one file per top level suite.\n\n#### options.junit.template\nType: `String`  \nDefault: `undefined`\n\nSpecify a custom JUnit template instead of using the default `junitTemplate`.\n\n#### options.host\nType: `String`  \nDefault: `''`\n\nThe host you want Headless Chrome to connect against to run your tests.\n\ne.g. if using an ad hoc server from within grunt\n\n```js\nhost : 'http://127.0.0.1:8000/'\n```\n\nWithout a `host`, your specs will be run from the local filesystem.\n\n#### options.template\nType: `String` `Object`  \nDefault: `undefined`\n\nCustom template used to generate your Spec Runner. Parsed as underscore templates and provided\nthe expanded list of files needed to build a specrunner.\n\nYou can specify an object with a `process` method that will be called as a template function.\nSee the [Template API Documentation](https://github.com/gruntjs/grunt-contrib-jasmine/wiki/Jasmine-Templates) for more details.\n\n#### options.templateOptions\nType: `Object`  \nDefault: `{}`\n\nOptions that will be passed to your template. Used to pass settings to the template.\n\n#### options.polyfills\nType: `String|Array`\n\nThird party polyfill libraries like json2 that are loaded at the very top before anything else.\n\n#### options.display\nType: `String`  \nDefault: `'full'`\n\n  * `full` displays the full specs tree\n  * `short` only displays a success or failure character for each test (useful with large suites)\n  * `none` displays nothing\n\n#### options.allowFileAccess\nType: `Boolean`\nDefault: `false`\n\nLaunches puppeteer with --allow-file-access-from-files (Fix Issue https://github.com/gruntjs/grunt-contrib-jasmine/issues/298)\n\n#### options.timeout\nType: `Number`\nDefault: `30000`\n\nChange the puppeteer default timeout value in milliseconds (reference: https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#pagesetdefaulttimeouttimeout)\n\n\n#### options.sandboxArgs\nType: `Object`\nDefault: `{ args: [] }`\n\nPass arugments to puppeteer launcher. For the list of available options, please look at [puppeteer launch options](https://pptr.dev/#?product=Puppeteer\u0026version=v3.0.1\u0026show=api-puppeteerlaunchoptions).\n\nExample `sandboxArgs` object:\n```js\n{\n  args: {\n    '=-allow-file-access-from-files'\n  },\n  executeablePath: '/some/other/path/to/chrome'\n}\n```\n\n#### options.summary\nType: `Boolean`  \nDefault: `false`\n\nDisplay a list of all failed tests and their failure messages\n\n### Flags\n\nName: `build`\n\nTurn on this flag in order to build a SpecRunner html file. This is useful when troubleshooting templates,\nrunning in a browser, or as part of a watch chain e.g.\n\n```js\nwatch: {\n  pivotal : {\n    files: ['src/**/*.js', 'specs/**/*.js'],\n    tasks: 'jasmine:pivotal:build'\n  }\n}\n```\n\n### Filtering specs\n\n**filename**\n`grunt jasmine --filter=foo` will run spec files that have `foo` in their file name.\n\n**folder**\n`grunt jasmine --filter=/foo` will run spec files within folders that have `foo*` in their name.\n\n**wildcard**\n`grunt jasmine --filter=/*-bar` will run anything that is located in a folder `*-bar`\n\n**comma separated filters**\n`grunt jasmine --filter=foo,bar` will run spec files that have `foo` or `bar` in their file name.\n\n**flags with space**\n`grunt jasmine --filter=\"foo bar\"` will run spec files that have `foo bar` in their file name.\n`grunt jasmine --filter=\"/foo bar\"` will run spec files within folders that have `foo bar*` in their name.\n\n#### Example application usage\n\n- [Pivotal Labs' sample application](https://github.com/jsoverson/grunt-contrib-jasmine-example)\n\n\n#### Basic Use\n\nSample configuration to run Pivotal Labs' example Jasmine application.\n\n```js\n// Example configuration\ngrunt.initConfig({\n  jasmine: {\n    pivotal: {\n      src: 'src/**/*.js',\n      options: {\n        specs: 'spec/*Spec.js',\n        helpers: 'spec/*Helper.js'\n      }\n    }\n  }\n});\n```\n\n#### Supplying a custom template\n\nSupplying a custom template to the above example\n\n```js\n// Example configuration\ngrunt.initConfig({\n  jasmine: {\n    customTemplate: {\n      src: 'src/**/*.js',\n      options: {\n        specs: 'spec/*Spec.js',\n        helpers: 'spec/*Helper.js',\n        template: 'custom.tmpl'\n      }\n    }\n  }\n});\n```\n\n#### Supplying template modules and vendors\n\nA complex version for the above example\n\n```js\n// Example configuration\ngrunt.initConfig({\n  jasmine: {\n    customTemplate: {\n      src: 'src/**/*.js',\n      options: {\n        specs: 'spec/*Spec.js',\n        helpers: 'spec/*Helper.js',\n        template: require('exports-process.js'),\n        vendor: [\n          'vendor/*.js',\n          'http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'\n        ]\n      }\n    }\n  }\n});\n```\n\n#### Passing options to sandbox (puppeteer)\n\nSee [puppeteer launch options](https://pptr.dev/#?product=Puppeteer\u0026version=v3.0.1\u0026show=api-puppeteerlaunchoptions) for a complete list of arguments.\n\n```js\n// Example configuration\ngrunt.initConfig({\n  jasmine: {\n    customTemplate: {\n      src: 'src/**/*.js',\n      options: {\n        specs: 'spec/*Spec.js',\n        helpers: 'spec/*Helper.js',\n        template: 'custom.tmpl',\n        sandboxArgs: {\n          args: ['--no-sandbox'],\n          timeout: 3000,\n          defaultViewport: {\n            isMobile: true\n          }\n        }\n      }\n    }\n  }\n});\n```\n\n#### Sample RequireJS/NPM Template usage\n\n```js\n// Example configuration\ngrunt.initConfig({\n  jasmine: {\n    yourTask: {\n      src: 'src/**/*.js',\n      options: {\n        specs: 'spec/*Spec.js',\n        template: require('grunt-template-jasmine-requirejs')\n      }\n    }\n  }\n});\n```\n\nNPM Templates are just node modules, so you can write and treat them as such.\n\nPlease see the [grunt-template-jasmine-requirejs](https://github.com/jsoverson/grunt-template-jasmine-requirejs) documentation\nfor more information on the RequireJS template.\n\n#### Keeping temp files in an existing directory\n\nSupplying a custom temp directory\n\n```js\n// Example configuration\ngrunt.initConfig({\n  jasmine: {\n    pivotal: {\n      src: 'src/**/*.js',\n      options: {\n        keepRunner: true,\n        tempDir: 'bin/jasmine/',\n        specs: 'spec/*Spec.js',\n        helpers: 'spec/*Helper.js'\n      }\n    }\n  }\n});\n```\n\n\n## Release History\n\n * 2023-01-12   v4.0.0   Dependency Updates requires node 14+ requires jasmine 3.9.0+ bump puppeteer to version 19\n * 2021-05-13   v3.0.0   Dependency Updates drop node 8 support bump puppeteer to 8.0.0\n * 2020-05-04   v2.2.0   Dependency updates set the default option timeout value to 30 secs to sync with puppeteer's default timeout value. options.sandboxArgs; passing options to puppeteer\n * 2019-07-31   v2.1.3   Fix security deps Update Puppeteer\n * 2018-11-14   v2.0.3   [object Object] Build only should pass if the buildSpecrunner runs without error\n * 2018-08-13   v2.0.2   Fix noSandbox option. Fix startTime, and timing issues.\n * 2018-05-31   v2.0.1   Use the grunt current working directory to find the jasmine core. Implement options.version. Dependency updates.\n * 2018-05-19   v2.0.0   Switch from PhantomJS to Chrome Headless via Puppeteer\n * 2017-01-12   v1.1.0   adds `tempDir` option. locks jasmine version\n * 2016-04-07   v1.0.3   Move to a non-deprecated sprintf.\n * 2016-04-07   v1.0.2   Fix sprintf issues in error calls.\n * 2016-04-07   v1.0.1   Allow to use custom bootfile. Doc updates. Fix and use lodash directly.\n * 2016-01-26   v1.0.0   Bump grunt-lib-phantomjs to 1.0.0. Bump jasmine to 2.2.0.\n * 2015-09-24   v0.9.2   Fixes npm@3 issues.\n * 2015-09-04   v0.9.1   Fix summary logging.\n * 2015-07-10   v0.9.0   Fix deprecated package.json licenses. Fix Phantomjs dependency to include correct phantom kill.\n * 2015-01-08   v0.8.2   Fixes to test summary reporting.\n * 2014-10-20   v0.8.1   Now removes listeners when using the build flag. Adds handler for `fail.load`.\n * 2014-07-26   v0.8.0   Plugin now uses Jasmine 2.0.4 from npm. Updates other dependencies. Added `options.polyfills`.\n * 2014-07-26   v0.7.0   Merged #153 to add stack trace to summary. Updated for Jasmine 2.0.1. Merged #133 for minimal output. Merged #139 changing file exclusion logic.\n * 2014-05-31   v0.6.5   Option to allow specifying a `junitTemplate`.\n * 2014-04-28   v0.6.4   Indent level fix. Moved scripts inside the body tag.\n * 2014-01-29   v0.6.0   Jasmine 2.0.0 support. Improved logging support. Various merges/bugfixes.\n * 2013-08-02   v0.5.2   Fixed breakage with iframes / #44. Added filter flag / #70. Fixed junit failure output / #77.\n * 2013-06-18   v0.5.1   Merged #69: grunt async not called when tests fail or `keepRunner` is true.\n * 2013-06-15   v0.5.0   Updated rimraf. Made teardown async. Added Function.prototype.bind polyfill. Breaking (templates) changed input options for `getRelativeFileList`. Breaking (usage) failing task on phantom error (SyntaxError, TypeError, et al).\n * 2013-04-03   v0.4.2   Updated grunt-lib-phantomjs to 0.3.0/1.9 (closes #45). Merged #38, #51. Addressed #40, #43, #48, #45.\n * 2013-03-08   v0.4.0   Updated grunt-lib-phantomjs to 0.2.0/1.8. Allowed spec/vendor/helper list to return non-matching files (e.g. for remote, http). Merged #30, #34.\n * 2013-02-24   v0.3.3   Added better console output (via Gabor Kiss @Neverl).\n * 2013-02-17   v0.3.2   Ensure Gruntfile.js is included on npm.\n * 2013-02-15   v0.3.1   First official release for Grunt 0.4.0.\n * 2013-01-22   v0.3.1rc7   Exposed phantom and sendMessage to templates\n * 2013-01-22   v0.3.0rc7   Updated dependencies for grunt v0.4.0rc6/rc7\n * 2013-01-08   v0.3.0rc5   Updating to work with grunt v0.4.0rc5. Switching to `this.filesSrc` API. Added JUnit xml output (via Kelvin Luck @vitch). Passing `console.log` from browser to verbose grunt logging. Support for templates as separate node modules. Removed internal requirejs template (see grunt-template-jasmine-requirejs).\n * 2012-12-03   v0.2.0   Generalized requirejs template config. Added loader plugin. Tests for templates. Updated jasmine to 1.3.0.\n * 2012-11-24   v0.1.2   Updated for new grunt/grunt-contrib APIs.\n * 2012-11-07   v0.1.1   Fixed race condition in requirejs template.\n * 2012-11-07   v0.1.0   Ported grunt-jasmine-runner and grunt-jasmine-task to grunt-contrib.\n\n---\n\nTask submitted by [Jarrod Overson](http://jarrodoverson.com)\n\n*This is a generated file.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruntjs%2Fgrunt-contrib-jasmine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgruntjs%2Fgrunt-contrib-jasmine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruntjs%2Fgrunt-contrib-jasmine/lists"}