Created
February 13, 2014 22:44
-
-
Save addisonj/8985471 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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