mocha commnad giving ReferenceError: window is not defined

1,033 views
Skip to first unread message

jit

unread,
Dec 3, 2015, 1:37:12 AM12/3/15
to Mocha
I am using below command

mocha --compilers :./test/babel-setup.js --recursive --watch

giving below error:

ReferenceError: window is not defined

in babel-setup.js below code is there.

require("babel/register")({
  compact: false
});

i am using node 0.12.7 and "mocha": "^2.2.5" and "jsdom": "^3.1.2". am i missing sonething?



Vlad GURDIGA

unread,
Dec 31, 2015, 9:04:54 AM12/31/15
to Mocha
Hey jit,

My guess is that your test setup or code is expecting a browser environment, and If that’s true, I’d try to look into Phantomjs.

Cheers!
Reply all
Reply to author
Forward
0 new messages