Hi, there are several modules that have a toplevel 'test.js' that is run from package.json (instead of shell script).
An example is: https://github.com/laverdet/node-fibers/blob/master/test.js https://github.com/laverdet/node-fibers/blob/master/package.json#L12 Best regards, Jeroen On 23 mei, 12:15, Angel Java Lopez <[email protected]> wrote: > Hi people! > > Ok, I'm a bit lazy, I was reading only two or three pages of npm manual, > and browsing few modules at GitHub. > > My context: I'm writing a module. I want to use require('assert') instead > nodeunit (the module is relatively small, nodeunit would be greater than > the module ;-). I want to have different .js files in test folder, each one > testing a different feature of the module. > > I see that npm uses script object at package.json. And I see that some > modules launch something like make test, where the test files are processes > in a for, etc.... But, AFAIK, those scripts are written for Unix/Linux. > Good for my Ubuntu box. But when I (or a user) got the code at Windows, we > lost "npm test" functionality > > Any example, way of writing a multiple test invocation, supported my > Linux/Windows? Module/Github as example? > > My first idea: launch a .js file than using fs and process, would discover > and launch each test file. > > Or there is a npm feature I missed? > > (When I use nodeunit, I added a nodeunit.cmd for Windows, that launch > nodeunit and I pass the test folder to it. Then script: "nodeunit test" in > package.json makes the trick) > > Angel "Java" Lopezhttp://ajlopez.wordpress.comhttp://twitter.com/ajlopez -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
