Skip to content

Instantly share code, notes, and snippets.

@JamieMason
Created May 7, 2014 09:39
Show Gist options
  • Save JamieMason/8c26b0b73fb77f189299 to your computer and use it in GitHub Desktop.
Save JamieMason/8c26b0b73fb77f189299 to your computer and use it in GitHub Desktop.
Add the Karma test runner and standardise settings in your project with Sublime Text.
{
"folders": [{
"follow_symlinks": true,
"path": "."
}],
"settings": {
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
"tab_size": 2,
"file_exclude_patterns": [
"*.sublime-project",
"*.sublime-workspace",
"*.min.*"
],
"folder_exclude_patterns": [
"node_modules",
"reports",
".git",
".svn"
],
"rulers": [
100
],
"translate_tabs_to_spaces": true,
"trim_automatic_white_space": true,
"trim_trailing_white_space_on_save": true
},
"build_systems": [{
"name": "test",
"path": "$HOME/.nvm/v0.10.26/bin:$PATH",
"cmd": [
"node_modules/karma/bin/karma",
"start",
"test/config/karma.conf.js",
"--no-colors",
"--single-run",
"--log-level",
"disable",
"--reporters",
"dots"
],
"selector": "source.js",
"working_dir": "$project_path"
}]
}
@JamieMason
Copy link
Author

  1. Save this file in the root of your project.
  2. Open the project using that file, rather than opening Sublime Text at that directory.
  3. Command+B will run Karma.
  4. You can optionally set Karma to run on every save.

@mmahalwy
Copy link

mmahalwy commented Sep 7, 2014

What does this look like?!

@JamieMason
Copy link
Author

The Karma Build? It shows up in your Sublime Console @mmahalwy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment