Skip to content

Commit f06b560

Browse files
committed
Add failing test for historyApiFallback.
Ref #625
1 parent 06a6d8e commit f06b560

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

test/HistoryApiFallback.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
var path = require("path");
12
var request = require("supertest");
23
var helper = require("./helper");
34
var config = require("./fixtures/historyapifallback-config/webpack.config");
5+
var config2 = require("./fixtures/historyapifallback-2-config/webpack.config");
46

57
describe("HistoryApiFallback", function() {
68
var server;
@@ -39,4 +41,22 @@ describe("HistoryApiFallback", function() {
3941
.expect(200, /Foobar/, done);
4042
});
4143
});
44+
45+
describe("as object with contentBase", function() {
46+
before(function(done) {
47+
server = helper.start(config2, {
48+
contentBase: path.join(__dirname, "fixtures/historyapifallback-2-config"),
49+
historyApiFallback: {
50+
index: "/bar.html"
51+
}
52+
}, done);
53+
req = request(server.app);
54+
});
55+
56+
it("historyApiFallback should take preference above magicHtml", function(done) {
57+
req.get("/")
58+
.accept("html")
59+
.expect(200, /Foobar/, done);
60+
});
61+
});
4262
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Foobar
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Hey.");
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
context: __dirname,
3+
entry: "./foo.js",
4+
output: {
5+
filename: "bundle.js",
6+
path: "/"
7+
}
8+
};

0 commit comments

Comments
 (0)