Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Zombie.js be used with static HTML files or the file:// protocol?

Tags:

zombie.js

I've recently started looking into using Zombie.js + Mocha + Node.js as a unit testing framework for JavaScript files intended to be used client-side (e.g. in a browser).

Reading over the documentation though, I'm beginning to wonder if Zombie.js can be used for this purpose:

// Load the page from localhost
browser = new Browser();
browser.visit("http://localhost:3000/", function () { ... });

There doesn't seem to be any API for loading a static HTML file with Zombie.js. Can it be done? Can I just 'visit' a file:// URL and have it work? Or would I need to set up some sort of server on localhost for serving static HTML files? Is Zombie.js even a good choice for this sort of testing?

like image 558
Ajedi32 Avatar asked Oct 02 '22 09:10

Ajedi32


1 Answers

Yes. it supports loading static html files over file:// protocol. see change log: https://github.com/assaf/zombie/blob/master/CHANGELOG.md#version-096--2011-07-28

like image 129
shawnzhu Avatar answered Oct 05 '22 12:10

shawnzhu