Skip to content

Instantly share code, notes, and snippets.

@arturopie
Created June 4, 2014 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arturopie/99f6dfc97a74bd37d0f4 to your computer and use it in GitHub Desktop.
Save arturopie/99f6dfc97a74bd37d0f4 to your computer and use it in GitHub Desktop.
Observr configuration to run karma tests
# setup: gem install observr
# usage:
# observr run_js_specs.rb
watch('spec/.*_spec.js') { |_| run_all_tests }
watch('client/.*.js') { |_| run_all_tests }
def run_all_tests
puts "RUNNING ALL TESTS"
system 'xvfb-run --auto-servernum node_modules/karma/bin/karma start karma.amd.conf.js --single-run'
end
Signal.trap('QUIT') { run_all_tests }
Signal.trap('INT') { abort('\n') }
run_all_tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment