change output filesystem to be in memory and linux style

This commit is contained in:
Tobias Koppers 2017-02-09 12:28:26 +01:00 committed by GitHub
parent 8ecae31c67
commit fcb219d968
1 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,9 @@ describe("Compiler", function() {
var c = webpack(options); var c = webpack(options);
var files = {}; var files = {};
c.outputFileSystem = { c.outputFileSystem = {
join: path.join.bind(path), join: function() {
return [].join.call(arguments, "/").replace(/\/+/g, "/");
},
mkdirp: function(path, callback) { mkdirp: function(path, callback) {
logs.mkdirp.push(path); logs.mkdirp.push(path);
callback(); callback();
@ -55,17 +57,15 @@ describe("Compiler", function() {
}); });
} }
it("should compile a single file to deep output", function(done) { it("should compile a single file to deep output", function(done) {
var sep = path.sep;
compile("./c", { compile("./c", {
output: { output: {
path: "/what", path: "/what",
filename: "the" + sep + "hell.js", filename: "the/hell.js",
} }
}, function(stats, files) { }, function(stats, files) {
stats.logs.mkdirp.should.eql([ stats.logs.mkdirp.should.eql([
"/what", "/what",
"/what" + sep + "the", "/what/the",
]); ]);
done(); done();
}); });