Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to call jasmine-node from ant build.xml

How to call jasmine-node from ant build.xml

Problem

I'm trying to use jasmine-node for our testing of js files. We've written some specs and everything is going smoothly when we test from command line.

However, we're trying to include our tests in our ant build and I've tried several combinations of:

    

dir.src is just the base directory where our js files and specs live. The combinations have been to try and move both values into a line and all three into a line, etc.

As I said, putting "jasmine-node --verbose --test-dir directory" works great in command line.

If anyone can provide any help here, that would be great.

Thanks!

EDIT: I have this in a trycatch block. Here's the whole thing:

    

Thus, the output in the console is "Jasmine tests failing"

Problem courtesy of: geekonablog

Solution

After removing the trycatch block, I got an Error Message saying that you can't have verbose="true" in an exec, though I would swear that I saw that somewhere before. The verbose was always making it fail, though because I had a catch in there, I wasn't getting a good error message. I'll be putting the trycatch back in now that I can get the command to run because if the developer building doesn't have jasmine installed, we'll want the build to fail.

Here's my working jasmine-node call.

This prints the normal trace stuff that I get when I run jasmine-node in command line, which is exactly what I wanted.

Also, the apply above was just something I was trying to make it work. What I really wanted was an exec, which is what I had at first.

Solution courtesy of: geekonablog

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

How to call jasmine-node from ant build.xml

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×