petrbela / karma-osx-reporter Goto Github PK
View Code? Open in Web Editor NEWReport Karma test runner results to OSX Notification Center
License: MIT License
Report Karma test runner results to OSX Notification Center
License: MIT License
The port is currently hard-coded. Allow it to be changed in the Karma config, for those who already use 1337.
Is there a way to only show the notification when tests are failing? I want to disable the "passed" message because it shows too often when you run tests on each file change.
Thanks
In more recent versions of karma, adding the following to your config file will actually break things
plugins: [
'karma-osx-reporter'
]
This overrides the default of plugins: ['karma-*']
, which is how plugins are loaded automatically, including the default ones. So you don't need to add this at all or you need to include each plugin explicitly.
So you may want to tweak this in the Readme because it threw me off for a bit.
When I try to include an OSX reporter to help out OSX developers, I get this error on Ubuntu when I run grunt :
Running "karma:continuous" (karma) task
INFO [reporter.osx]: OSX Notification Center reporter started at http://localhost:1337
INFO [karma]: Karma v0.10.2 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [reporter.osx]: node-osx-notifier exited with code 8
INFO [PhantomJS 1.9.2 (Linux)]: Connected on socket QB2sm3rLNoA3QQWHs7Cs
..................................................................
PhantomJS 1.9.2 (Linux): Executed 66 of 66 SUCCESS (0.254 secs / 0.013 secs)
ERROR [reporter.osx]: error: socket hang up
Even worse: when I hook up Karma to run when files change, I get an error I can replicate like this:
adam@ares:~/src/js-uglydb :master$ grunt karma:unit wait-for-karma karma:unit:run karma:unit:run karma:unit:run karma:unit:run
Running "karma:unit" (karma) task
Running "wait-for-karma" task
Running "karma:unit:run" (karma) task
[2013-10-27 12:21:39.604] [DEBUG] config - Loading config /home/adam/src/js-uglydb/test/karma.conf.js
Fatal error: socket hang up
adam@ares:~/src/js-uglydb :master$
... as you can see, grunt stops completely and no longer monitors files for changes.
This isn't very nice: if I include karma-osx-reporter in my project, then it kills my development cycle for non-OSX users.
index.js:80 checks for results.error and sets the appropriate message. but this message is set to ERROR even if tests simply failed, in which case the first else-if needs to run.
karma0.12.32 sets results.error to true on test failure.
node v0.10.21
The error in the terminal says
INFO [reporter.osx]: node-osx-notifier exited with code 130
It was working before the Mavericks upgrade.
code/clutter [master] » npm install -g karma-osx-reporter
/usr/local/lib
├── UNMET PEER DEPENDENCY karma@>=0.9
└── [email protected]
npm WARN [email protected] requires a peer of karma@>=0.9 but none was installed.
code/clutter [master] » karma --version
Karma version: 0.13.22
code/clutter [master] » which karma
./node_modules/.bin/karma
It's saying "but none was installed". However, the following two commands make me think that Karma is installed and is >=0.9
. I've also been using Karma successfully in this project for a while.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.