mocha command giving ReferenceError: window is not defined

后端 未结 3 801
暖寄归人
暖寄归人 2020-12-14 15:29

I am using command:

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

It is giving error:

ReferenceError: window         


        
3条回答
  •  温柔的废话
    2020-12-14 15:45

    To test frontend libraries with mocha you need the node modul mocha-jsdom you find it here: https://www.npmjs.com/package/mocha-jsdom

提交回复
热议问题