Skip to content

Commit ca2251e

Browse files
filipesilvaSpaceK33z
authored andcommitted
Add failing test for #640
1 parent 0b1f7ce commit ca2251e

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

test/HistoryApiFallback.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,20 @@ describe("HistoryApiFallback", function() {
110110
.expect(200, /Other file/, done);
111111
});
112112
});
113+
114+
describe("in-memory files", function() {
115+
before(function(done) {
116+
server = helper.start(config2, {
117+
contentBase: path.join(__dirname, "fixtures/historyapifallback-3-config"),
118+
historyApiFallback: true
119+
}, done);
120+
req = request(server.app);
121+
});
122+
123+
it("should take precedence over contentBase files", function(done) {
124+
req.get("/foo")
125+
.accept("html")
126+
.expect(200, /In-memory file/, done);
127+
});
128+
});
113129
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
In-memory file
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
require("./bar.html");
2+
console.log("Hey.");
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
contentBase file
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
context: __dirname,
3+
entry: "./foo.js",
4+
output: {
5+
filename: "bundle.js",
6+
path: "/"
7+
},
8+
module: {
9+
loaders: [
10+
{
11+
test: /\.html$/,
12+
loader: "file",
13+
query: { name: "index.html" }
14+
}
15+
]
16+
}
17+
};

0 commit comments

Comments
 (0)