From 3940488b976d5405c8a6b02f096b7bbef9632079 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Fri, 1 Dec 2017 19:12:18 -0500 Subject: [PATCH] Fix an http test failing due to new static resource URL prefixes. --- packages/http/httpcall_tests.js | 26 ++++++++++++++++---------- packages/modern-browsers/TODO.md | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/http/httpcall_tests.js b/packages/http/httpcall_tests.js index 7008d020f6..6be8a78d1b 100644 --- a/packages/http/httpcall_tests.js +++ b/packages/http/httpcall_tests.js @@ -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/); diff --git a/packages/modern-browsers/TODO.md b/packages/modern-browsers/TODO.md index 42c5a31155..c4199acdbe 100644 --- a/packages/modern-browsers/TODO.md +++ b/packages/modern-browsers/TODO.md @@ -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)?