Skip to content

Commit a9c4a9b

Browse files
committed
Add tests for filesystem
Ref #120, #121
1 parent 92403e9 commit a9c4a9b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/FileSystem.test.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
var should = require("should");
2+
var middleware = require("../middleware");
3+
4+
var fakeWebpack = function() {
5+
return {
6+
watch: function() {
7+
return {};
8+
},
9+
plugin: function() {}
10+
};
11+
};
12+
13+
describe("FileSystem", function() {
14+
it("should set outputFileSystem on compiler", function() {
15+
var compiler = fakeWebpack();
16+
middleware(compiler);
17+
should(compiler.outputFileSystem).be.ok();
18+
});
19+
20+
it("should reuse outputFileSystem from compiler", function() {
21+
var compiler = fakeWebpack();
22+
middleware(compiler);
23+
var firstFs = compiler.outputFileSystem;
24+
middleware(compiler);
25+
var secondFs = compiler.outputFileSystem;
26+
27+
should.strictEqual(firstFs, secondFs);
28+
});
29+
});

0 commit comments

Comments
 (0)