├── .eslintrc ├── .gitignore ├── .npmignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── gruntfile.js ├── index.js └── package.json /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "standard" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .* 2 | 3 | Gruntfile.coffee 4 | CONTRIBUTING.md 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "0.10" 5 | - "0.12" 6 | - 4 7 | - 5 8 | 9 | # Make sure we have new NPM. 10 | before_install: 11 | - npm install -g npm 12 | - npm config set loglevel warn 13 | 14 | before_script: 15 | - export DISPLAY=:99.0 16 | - sh -e /etc/init.d/xvfb start 17 | - npm install -g grunt-cli 18 | 19 | script: 20 | - grunt 21 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | # [1.0.0](https://github.com/karma-runner/karma-script-launcher/compare/v0.2.0...v1.0.0) (2016-05-04) 3 | 4 | 5 | 6 | 7 | # [0.2.0](https://github.com/karma-runner/karma-script-launcher/compare/v0.1.0...v0.2.0) (2016-03-03) 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Please see the [Contributing to Karma] guide for information on contributing to this project. 2 | 3 | [Contributing to Karma]: https://github.com/karma-runner/karma/blob/master/CONTRIBUTING.md 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (C) 2011-2013 Google, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # karma-script-launcher 2 | 3 | [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard) 4 | [![npm version](https://img.shields.io/npm/v/karma-script-launcher.svg?style=flat-square)](https://www.npmjs.com/package/karma-script-launcher) [![npm downloads](https://img.shields.io/npm/dm/karma-script-launcher.svg?style=flat-square)](https://www.npmjs.com/package/karma-script-launcher) 5 | 6 | [![Build Status](https://img.shields.io/travis/karma-runner/karma-script-launcher/master.svg?style=flat-square)](https://travis-ci.org/karma-runner/karma-script-launcher) [![Dependency Status](https://img.shields.io/david/karma-runner/karma-script-launcher.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-script-launcher) [![devDependency Status](https://img.shields.io/david/dev/karma-runner/karma-script-launcher.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-script-launcher#info=devDependencies) 7 | 8 | > Shell script launcher for [Karma](https://github.com/karma-runner/karma) 9 | 10 | This plugin allows you to use a shell script as a browser launcher. The script has to accept 11 | a single argument - the url that the browser should open. 12 | 13 | ## Installation 14 | 15 | Install using 16 | 17 | ```bash 18 | $ npm install karma-script-launcher --save-dev 19 | ``` 20 | 21 | ## Configuration 22 | 23 | ```js 24 | // karma.conf.js 25 | module.exports = function(config) { 26 | config.set({ 27 | browsers: ['/usr/local/bin/my-custom.sh'] 28 | }) 29 | } 30 | ``` 31 | 32 | You can pass list of browsers as a CLI argument too: 33 | 34 | ```bash 35 | $ karma start --browsers /some/custom/script.sh 36 | ``` 37 | 38 | ---- 39 | 40 | For more information on Karma see the [homepage]. 41 | 42 | [homepage]: http://karma-runner.github.com 43 | -------------------------------------------------------------------------------- /gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function (grunt) { 2 | grunt.initConfig({ 3 | pkg: grunt.file.readJSON('package.json'), 4 | 5 | pkgFile: 'package.json', 6 | 7 | eslint: { 8 | target: [ 9 | '*.js' 10 | ] 11 | }, 12 | 13 | conventionalChangelog: { 14 | release: { 15 | options: { 16 | changelogOpts: { 17 | preset: 'angular' 18 | } 19 | }, 20 | src: 'CHANGELOG.md' 21 | } 22 | }, 23 | 24 | conventionalGithubReleaser: { 25 | release: { 26 | options: { 27 | auth: { 28 | type: 'oauth', 29 | token: process.env.GH_TOKEN 30 | }, 31 | changelogOpts: { 32 | preset: 'angular' 33 | } 34 | } 35 | } 36 | }, 37 | 38 | bump: { 39 | options: { 40 | commitMessage: 'chore: release v%VERSION%', 41 | pushTo: 'upstream', 42 | commitFiles: [ 43 | 'package.json', 44 | 'CHANGELOG.md' 45 | ] 46 | } 47 | }, 48 | 49 | 'npm-contributors': { 50 | options: { 51 | commitMessage: 'chore: Update contributors' 52 | } 53 | } 54 | }) 55 | 56 | require('load-grunt-tasks')(grunt) 57 | 58 | grunt.registerTask('default', ['eslint']) 59 | 60 | grunt.registerTask('release', 'Bump the version and publish to npm.', function (type) { 61 | grunt.task.run([ 62 | 'npm-contributors', 63 | 'bump:' + (type || 'patch') + ':bump-only', 64 | 'conventionalChangelog', 65 | 'bump-commit', 66 | 'conventionalGithubReleaser', 67 | 'npm-publish' 68 | ]) 69 | }) 70 | } 71 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var ScriptBrowser = function (baseBrowserDecorator, script) { 2 | baseBrowserDecorator(this) 3 | 4 | this.name = script 5 | 6 | this._getCommand = function () { 7 | return script 8 | } 9 | } 10 | 11 | ScriptBrowser.$inject = ['baseBrowserDecorator', 'name'] 12 | 13 | // PUBLISH DI MODULE 14 | module.exports = { 15 | 'launcher:Script': ['type', ScriptBrowser] 16 | } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "karma-script-launcher", 3 | "version": "1.0.0", 4 | "description": "A Karma plugin. Launcher for shell scripts.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git://github.com/karma-runner/karma-script-launcher.git" 12 | }, 13 | "keywords": [ 14 | "karma-plugin", 15 | "karma-launcher", 16 | "script" 17 | ], 18 | "author": "Vojta Jina ", 19 | "dependencies": {}, 20 | "peerDependencies": { 21 | "karma": ">=0.9" 22 | }, 23 | "license": "MIT", 24 | "devDependencies": { 25 | "eslint": "^2.2.0", 26 | "eslint-config-standard": "^5.1.0", 27 | "eslint-plugin-promise": "^1.1.0", 28 | "eslint-plugin-standard": "^1.3.2", 29 | "grunt": "~0.4.1", 30 | "grunt-auto-release": "~0.0.2", 31 | "grunt-bump": "~0.7.0", 32 | "grunt-conventional-changelog": "^6.1.0", 33 | "grunt-conventional-github-releaser": "^1.0.0", 34 | "grunt-eslint": "^18.0.0", 35 | "grunt-npm": "~0.0.2", 36 | "load-grunt-tasks": "^3.4.1" 37 | }, 38 | "contributors": [ 39 | "dignifiedquire ", 40 | "Alex Kessock ", 41 | "Friedel Ziegelmayer " 42 | ] 43 | } 44 | --------------------------------------------------------------------------------