Build a stand-alone test harness with dynamic data to quickly prototype and isolate your HTML/CSS or examine your JSON document.
- Installation steps to setup and configure
- Recipe details
- Register
- Harness (array)
- Template View Engines
- Commands
- JSON browser extentions
- Roadmap
- Set up your package.json
npm initin your project folder - Install with npm:
npm install tuxharness --save-dev- Mac/Unix copy file
cp -nv "node_modules/tuxharness/tuxfile.js" "tuxfile.js" - Windows copy file
copy "node_modules/tuxharness/tuxfile.js" "tuxfile.js" - More example recipes starter sample tuxharness recipe or full sample
- Mac/Unix copy file
- Run the harness server
node ./node_modules/tuxharness/index.js- or add a script reference to your package.json like
"harness": "node ./node_modules/tuxharness/index.js"then execute withnpm run harness
portlocalhost server port number (default is 4000)staticserve static assets (img, js, css, fonts...)routeis a virtual web path - served by express.jsdirectoryis the physical path where the static assets are hosted
viewenginesarray of template view engine name as defined in npmpathis the physical path to the views folder - relative from your project root
routeis a virtual web path - served by express.jsviewis the physical path where the view is hosted - relative to your view folderdata(object) - passed into the view for transformationdata(string) - service call to request JSON datadata(function(callback, util)) - callback argument will async call to gather data passed into the view for transformation- callback type string/JSON: print to browser
- util type object
- getIpsumText Lorum Ipsum generator
- getJsonRoute type function(string route): wraps route name with localhost IP address with port and JSON path
- dust.js (sample in test folder)
npm install dustjs-linkedin --save
- Jade (sample in test folder)
npm install jade --save
- Many others supported by Consolidate.js
- install any additional engines in your project
- register your view engine in your project's JS file
npm run harnessSingle run server to serve the test harness environmentnpm run devRespawn-on-save server to serve the test harness environmentnpm run lintLint JS filesnpm testUnit test and coverage
- Firefox JSONView
- Chrome JSONView
- Safari safari-json-formatter
- Allow remote recipes
- Views and data too
- Host demo