eddyerburgh / avoriaz

🔬 a Vue.js testing utility library
https://eddyerburgh.gitbooks.io/avoriaz/content/
MIT License
759 stars 62 forks source link

Sizzle throws error that window is not defined #50

Closed timwis closed 7 years ago

timwis commented 7 years ago

Hello, I'm trying to use avoriaz with ava using a very basic example, even more basic than your ava example, but it's throwing an error that window is not defined, referencing sizzle. Any suggestions?

eddyerburgh commented 7 years ago

avoriaz needs a browser to run, like jsdom.

the avoriaz-ava example uses browserenv(which is a wrapper around jsdom) -

npm install --save-dev browser-env

Then, in a file that runs before your tests -

require('browser-env')()

You can see it here - https://github.com/eddyerburgh/avoriaz-ava-example/blob/master/test/.setup.js

Thanks for the issue, I'll add a check for window and throw a clearer error message 👍

timwis commented 7 years ago

Ah! Thanks for the quick reply