Skip to content

Instantly share code, notes, and snippets.

@redsquirrel
Created August 11, 2011 15:23
Show Gist options
  • Save redsquirrel/1139929 to your computer and use it in GitHub Desktop.
Save redsquirrel/1139929 to your computer and use it in GitHub Desktop.
put this in a directory called 'spec' and then run 'jasmine-node spec/'
var fs = require("fs");
console.log("about to read, yo!");
describe("your mom", function() {
it("is fun to talk about her", function() {
fs.readFile("spec/foo-spec.js", function(error, buffer) {
console.log("Here's the file!");
console.log(buffer);
asyncSpecDone(); // comment this out, and it will hang... cuz it's waiting
});
asyncSpecWait(); // comment this out, and node will merrily exit without firing the callback
})
})
console.log("exiting, yo!");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment