I'm trying to write unit tests for Angular application and right now working on describing all required packages for unit testing like karma,phantomjs etc. OS: Ubuntu 14.
The thing is that Phantom.js doesn't work without "libfontconfig" installed in the system (bug description) And as I understand it's not possible to install it with:
npm install --save-dev libfontconfig
How to output to user warning that certain installation is required when he tries to do:
npm install
UPD
I decided to provide more specific details on my case. So, I'm going to use Karma and Phantom.js to test my application. Here are all devDependencies of a project:
"devDependencies":
{
"grunt": "~0.4.5",
"grunt-contrib-less": "~1.1.0",
"grunt-contrib-watch": "~0.6.1",
"jit-grunt": "~0.9.1",
"angular-route": "~1.4.8",
"angular": "~1.4.8",
"moment": "~2.10.6",
"jquery": "~1.11.3",
"bootstrap": "~3.3.6",
"angularjs-datepicker": "~0.2.16",
"phantomjs": "~1.9.8",
"karma": "^0.12.16",
"karma-jasmine": "~0.1.0",
"karma-phantomjs-launcher": "~0.2.3"
}
When I try to run unit test with Karma:
node node_modules/karma/bin/karma start test/karma.conf.js
I receive the following error:
ERROR [phantomjs.launcher]: /vagrant/node_modules/phantomjs/lib/phantom/bin/phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory
So, my question is:
1) Should I check existence of this library or I can just describe it in README?
2) If I should check, how I can do it? Is it a good idea to use bash? As I understand it will not work on Windows machine in this case.