문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top