Fix an http test failing due to new static resource URL prefixes.

This commit is contained in:
Ben Newman
2017-12-01 19:12:18 -05:00
parent 8f921a4b87
commit 3940488b97
2 changed files with 17 additions and 11 deletions

View File

@@ -485,16 +485,22 @@ if (Meteor.isServer) {
// the x-suppress-error header).
WebApp.suppressConnectErrors();
var do_test = function (path, code, match) {
HTTP.get(
url_base() + path,
{headers: {'x-suppress-error': 'true'}},
expect(function(error, result) {
test.equal(result.statusCode, code);
if (match)
test.matches(result.content, match);
}));
};
function do_test(path, code, match) {
const prefix = Meteor.isModern
? "/__browser"
: "/__browser.legacy";
HTTP.get(url_base() + prefix + path, {
headers: {
"x-suppress-error": "true"
}
}, expect(function(error, result) {
test.equal(result.statusCode, code);
if (match) {
test.matches(result.content, match);
}
}));
}
// existing static file
do_test("/packages/local-test_http/test_static.serveme", 200, /static file serving/);

View File

@@ -32,7 +32,7 @@
- [ ] Fix dynamic module source map URLs (prepend `/__arch`).
- [ ] Fix tests failing because of changes to static resource URLs.
- [x] Fix tests failing because of changes to static resource URLs.
- [ ] In development, save time by only rebuilding `web.browser` (modern)?