Skip to content

Commit

Permalink
Add failing test for #640
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva authored and SpaceK33z committed Oct 8, 2016
1 parent 0b1f7ce commit ca2251e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/HistoryApiFallback.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,20 @@ describe("HistoryApiFallback", function() {
.expect(200, /Other file/, done);
});
});

describe("in-memory files", function() {
before(function(done) {
server = helper.start(config2, {
contentBase: path.join(__dirname, "fixtures/historyapifallback-3-config"),
historyApiFallback: true
}, done);
req = request(server.app);
});

it("should take precedence over contentBase files", function(done) {
req.get("/foo")
.accept("html")
.expect(200, /In-memory file/, done);
});
});
});
1 change: 1 addition & 0 deletions test/fixtures/historyapifallback-3-config/bar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In-memory file
2 changes: 2 additions & 0 deletions test/fixtures/historyapifallback-3-config/foo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require("./bar.html");
console.log("Hey.");
1 change: 1 addition & 0 deletions test/fixtures/historyapifallback-3-config/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
contentBase file
17 changes: 17 additions & 0 deletions test/fixtures/historyapifallback-3-config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
context: __dirname,
entry: "./foo.js",
output: {
filename: "bundle.js",
path: "/"
},
module: {
loaders: [
{
test: /\.html$/,
loader: "file",
query: { name: "index.html" }
}
]
}
};

0 comments on commit ca2251e

Please sign in to comment.