Closed pietrofxq closed 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.
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?
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?
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.
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
.
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.
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.
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?
No, mocha-casperjs.bat
is next to mocha-casperjs
so it will be in your path, so just call it like you were before
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.
Closing since you got it working and it appears to be a path issue for the other stuff.
Output:
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