Starting ZPT-JS
Asumming you have downloaded ZPT-JS before, move to the directory of ZPT-JS and use the next command to install the dependencies of ZPT-JS:
$ npm run install
Then use the next command to initialize a beefy server (port 9966) to make it easy to test ZPT-JS without browserifying by hand and a HTTP server (port 9000) to serve static files (HTML, CSS and JSON files):
$ npm run start
ZPT-JS uses Grunt as task runner tool. Grunt file uses:
- grunt-browserify. Build javascript files to be understood for browsers.
- grunt-contrib-watch. Watch changes of javascript files to invoke browserify automatically.
The web of ZPT-JS
Use the next command to initialize a HTTP server (port 9001) to serve static files of the web of ZPT-JS:
$ npm run web
Open http://localhost:9001 with your favourite browser to view the web of ZPT-JS.
Testing
ZPT-JS uses QUnit as testing framework. There are some different ways for testing ZPT-JS:
- Open http://localhost:9000/test/ with your favourite browser. Be careful: only related to browser test are run! All tests passed using last versions of Mozilla Firefox (68.0.1, 64-bit) and Chromium (74.0.3729.169, 64-bit). Perhaps some tests fail using other browsers!
-
Test ZPT-JS using console:
$ npm run testBrowser // Run the related to browser tests $ npm run testNode // Run the related to node.js tests $ npm run test // Run all tests
Some tests (errors.html
,folderDictionaries.html
andfolderDictionaries2.html
) show this error message several times:Failed to load resource: the server responded with a status of 404 (Not Found)
This is due to forced loading errors (errors.html
) or errors trying to load folder dictionaries (folderDictionaries.html
andfolderDictionaries2.html
). This is the expected behaviour.