nathanboktae / mocha-casperjs

Write CasperJS tests using Mocha
MIT License
120 stars 30 forks source link

dirname: too many arguments #66

Closed pietrofxq closed 8 years ago

pietrofxq commented 9 years ago

Output:

$ mocha-casperjs
dirname: too many arguments
Try `dirname --help' for more information.
/c/Users/Pietro Coelho/AppData/Roaming/npm/node_modules/mocha-casperjs/bin/m
-casperjs: line 31: readlink: command not found
/c/Users/Pietro Coelho/AppData/Roaming/npm/node_modules/mocha-casperjs/bin/m
-casperjs: line 36: /../../casperjs/bin/casperjs: No such file or directory

I have already installed: phantomjs, casperjs, mocha, chai, grunt-mocha-casperjs, grunt-casperjs.

I can run casperjs and phantomjs from the command line. Windows 8.1 64bit, using git bash

nathanboktae commented 9 years ago

Windows users need to use mocha-casperjs.bat. Try that. It wraps casperjs.exe as Casper also has special just for Windows code.

pietrofxq commented 9 years ago

It says that there is no tests and I should add my tests to a 'tests' folder in the current working directory. Already did that but doesn't seem to be working. Do I need to manually run mocha-casperjs.bat everytime I wanna run some tests?

nathanboktae commented 9 years ago

Are you using Cygwin or a normal windows shell? You can explicitly provide a path to your tests to, but it will non-recursively search a tests or tests folder in the current working directory.

Do I need to manually run mocha-casperjs.bat everytime I wanna run some tests?

Yes, did you expect a watcher deamon or something?

pietrofxq commented 9 years ago

I'm using git bash and the normal windows shell.

By current working directory you mean the project folder? Because that is where is my "tests" folder and the script doesn't seem to recognize it.

nathanboktae commented 9 years ago

By current working directory you mean the project folder?

No I mean current working directory.

What's the exact failure output? Also did you try running a single test as I mentioned before? like mocha-casperjs.bat test/mytest.js.

pietrofxq commented 9 years ago

Thanks for the explanation - got it working.

Why can't I use the TDD interface of mocha? It says "Can't find variable suite". And how to change the path of the tests folder? Definitely I don't want it inside node_modules.

nathanboktae commented 9 years ago

Glad you got it working.

Why can't I use the TDD interface of mocha? It says "Can't find variable suite".

BDD is just the default. Specify TDD via --ui tdd.

Definitely I don't want it inside node_modules.

Huh? how is it there? You can specify a path to a directory and it will read all the files in there, or specify tests individually.

pietrofxq commented 9 years ago

Well, mocha-casperjs.bat is inside the bin folder inside node_modules/mocha-casperjs. So should I move the .bat file to the project root folder and edit the paths inside the file?

nathanboktae commented 9 years ago

No, mocha-casperjs.bat is next to mocha-casperjs so it will be in your path, so just call it like you were before

pietrofxq commented 9 years ago

I don't think mocha-casperjs is on my path. I can only execute mocha-casperjs.bat that is inside the bin in node_modules, and having the test folder in the same folder of this bat file works. Using the command 'moscha-casperjs' or 'mocha-casperjs.bat' give me errors such as there is no such command.

nathanboktae commented 8 years ago

Closing since you got it working and it appears to be a path issue for the other stuff.