Open axelpale opened 8 years ago
Actually I want to move CLI parsing of mocha-phantomjs into the core. I started work on it just since I saw this issue (thanks for prompting me more) - https://github.com/nathanboktae/mocha-phantomjs-core/tree/cli-parsing
So in the future your example will be:
mocha-phantomjs tests/testrunner.html -v 512x512 --ignore-resource-errors
I'll add in a little shell wrapper for this to phantomjs and slimerjs too as mocha-phantomjs
and mocha-slimerjs
respectively
Great :) As long as we are not dependent on the version of phantomjs, this seems good to me. Although the command phantomjs mocha-phantomjs-core.js tests/testrunner.html ...
is nicely transparent, I can agree it is a bit tedious to point directly to the file mocha-phantomjs-core.js
. In practise I ended doing it like this: phantomjs node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js tests/testrunner.html ...
.
As long as we are not dependent on the version of phantomjs
Absolutely not. The shell wrapper would only work if you got things in your path. and I might not do it in the end if it's a pain :) but it should help out the common case of phantomjs
in your path and using npm scripts
so you can just do
{
"scripts": {
"test": "mocha-phantomjs tests/testrunner.html"
}
}
So far this does not work in npm scripts in package.json.
First of all, thanks for @nathanboktae for all the work on mocha-phantomjs. A big thing for devs like me.
But to the subject, I guess you have already thought about this. Currently the options are given in a quite grubby way:
The quoted/escaped JSON is hard to write and read. The number of quotes increases if the line is to be included in package.json script. In my case, the tests are run by
$ npm run test
so in the package.json I have something similar to the one above.What if we give a path to a JSON file? Like this:
or
and have a nice and readable
.mocha-phantomjs-core.json
:Would that be easy to implement?