lundi 29 décembre 2014

How to set up unit test boilerplate with grunt-init-gruntfile automatically?

I've been working with grunt cli's scaffolding (grunt-init-gruntfile) for a quick-start on learning Grunt / node. My expectation (based on grunt-init jquery) was I would run the following commands, filling out the fields as I went along



grunt-init gruntfile
npm init
npm install
grunt


and the result would be an empty project with unit tests, etc running against the empty js file (pkgname.js) as set in npm init. What basic steps am I missing to get from those commands to having the unit test boiler-plate ready to go?


What I have now is "Error: no test specified" after running grunt and the remaining tasks seem to be producing an empty files in my dist folder (except for the label). I notice it seems to assume the creation of ./lib/[package.name].js, but what I'm not sure is the quickstart to the qunit tests running via the Gruntfile. Is there a manual element here to creating the boilerplate for the test page and js files, etc? My goal is learning how to auto-create as much as possible using the grunt-cli.


I'm fairly new to node and I think there are some fundamentals I'm not grasping yet, I'm happy to elaborate if this question is too broad, poorly formed, etc.


Aucun commentaire:

Enregistrer un commentaire