{"id":15017421,"url":"https://github.com/egoist/vbuild-karma","last_synced_at":"2025-04-12T11:43:41.440Z","repository":{"id":45275062,"uuid":"80975753","full_name":"egoist/vbuild-karma","owner":"egoist","description":"Run unit tests with vbuild and Karma","archived":false,"fork":false,"pushed_at":"2021-12-25T14:31:48.000Z","size":90,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T15:50:53.865Z","etag":null,"topics":["jasmine","karma","phantomjs","unit-testing","vbuild","webpack"],"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/egoist.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":"2017-02-05T07:07:58.000Z","updated_at":"2018-09-25T02:31:00.000Z","dependencies_parsed_at":"2022-09-06T04:01:43.568Z","dependency_job_id":null,"html_url":"https://github.com/egoist/vbuild-karma","commit_stats":null,"previous_names":["egoist/vue-cli-karma"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fvbuild-karma","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fvbuild-karma/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fvbuild-karma/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egoist%2Fvbuild-karma/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egoist","download_url":"https://codeload.github.com/egoist/vbuild-karma/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248564056,"owners_count":21125405,"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":["jasmine","karma","phantomjs","unit-testing","vbuild","webpack"],"created_at":"2024-09-24T19:50:26.249Z","updated_at":"2025-04-12T11:43:41.422Z","avatar_url":"https://github.com/egoist.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vbuild-karma\n\n[![NPM version](https://img.shields.io/npm/v/vbuild-karma.svg?style=flat)](https://npmjs.com/package/vbuild-karma) [![NPM downloads](https://img.shields.io/npm/dm/vbuild-karma.svg?style=flat)](https://npmjs.com/package/vbuild-karma) [![Build Status](https://img.shields.io/circleci/project/egoist/vbuild-karma/master.svg?style=flat)](https://circleci.com/gh/egoist/vbuild-karma) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000\u0026style=flat)](https://github.com/egoist/donate)\n\n## Install\n\nThis module requires `vbuild` to be installed as devDependency.\n\n```bash\nyarn add vbuild vbuild-karma --dev\n```\n\n## Usage\n\n```js\n// config file: vbuild.karma.js\nconst karma = require('vbuild-karma')\n\nmodule.exports = {\n  // in test we don't need to split vendor code and minimize it\n  vendor: false,\n  minimize: false,\n  // run custom build process\n  run(webpackConfig) {\n    karma(webpackConfig)\n  }\n}\n```\n\nWe use `karma-phantomjs-launcher` `karma-spec-reporter` `karma-jasmine` `jasmine-core` by default.\n\nIn Continuous Integration Environment like CircleCi and TravisCi, the `singleRun` mode of Karma will be enabled.\n\n\n**Configure npm scripts**\n\n```js\n{\n  \"scripts\": {\n    \"test\": \"vbuild -c vbuild.karma.js\"\n  }\n}\n```\n\nYou can run the example by:\n\n```bash\ngit clone https://github.com/egoist/vbuild-karma.git\ncd vbuild-karma\nyarn\nyarn example\n```\n\n## API\n\n### karma(webpackConfig, testFiles, karmaConfig)\n\n#### webpackConfig\n\nFinal webpack config from vbuild\n\n#### testFiles\n\nDefault: `['test/unit/**/*.test.js']`\n\n#### karmaConfig\n\nType: `object` `string`\n\nWhen providing an `object` as `karmaConfig`, it will be assigned to [default karma config we use](/index.js#L9).\n\nWhen providing a `string` as `karmaConfig`, it will be treated as the path to karma config file, eg: `./test/unit/karma.conf.js`, and it will totally override the default karma config.\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n\n## Author\n\n**vbuild-karma** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.\u003cbr\u003e\nAuthored and maintained by egoist with help from contributors ([list](https://github.com/egoist/vbuild-karma/contributors)).\n\n\u003e [egoistian.com](https://egoistian.com) · GitHub [@egoist](https://github.com/egoist) · Twitter [@rem_rin_rin](https://twitter.com/rem_rin_rin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fvbuild-karma","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegoist%2Fvbuild-karma","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegoist%2Fvbuild-karma/lists"}