Skip to content

Instantly share code, notes, and snippets.

@addisonj
Created February 13, 2014 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save addisonj/8985471 to your computer and use it in GitHub Desktop.
Save addisonj/8985471 to your computer and use it in GitHub Desktop.
var fileProcessor = require("../lib/fileProcessor.js")
var assert = require("assert");
var fs = require("fs");
var decl = {
"id" : "some_unique_id",
"files" : [
{
"filename" : "main.js",
"contents" : "var o = require(\"./lib/other.js\");\nconsole.log(\"hello world\");\nconsole.log(o);",
"language" : "javascript"
},
{
"filename" : "lib/other.js",
"contents" : "module.exports=\"boop\"",
"language" : "javascript"
},
{
"filename" : "package.json",
"contents" : "{}",
"language" : "javascript"
}
],
"install" : "npm install .",
"run" : "node main.js",
"env" : {
"ENV_VAR" : "something",
"BOO" : "another"
}
}
var logger = {
debug: function() {}
}
describe("file processor", function () {
it("should create files that exist", function(done) {
fileProcessor.process(decl, "/tmp", logger, function(err) {
assert.ifError(err);
fs.exists("/tmp/main.js", function(exists) {
assert(exists);
done();
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment