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

StackOverflow https://stackoverflow.com/questions/22234073

  •  10-06-2023
  •  | 
  •  

سؤال

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