diff --git a/test/browser_NormandyApi.js b/test/browser_NormandyApi.js index 53ecc13a6..15e18266c 100644 --- a/test/browser_NormandyApi.js +++ b/test/browser_NormandyApi.js @@ -5,10 +5,14 @@ Cu.import("resource://shield-recipe-client/lib/NormandyApi.jsm", this); add_task(function* () { // Point the add-on to the test server. - SpecialPowers.setCharPref( - "extensions.shield-recipe-client.api_url", - "http://mochi.test:8888/browser/browser/extensions/shield-recipe-client/test", - ); + yield SpecialPowers.pushPrefEnv({ + set: [ + [ + "extensions.shield-recipe-client.api_url", + "http://mochi.test:8888/browser/browser/extensions/shield-recipe-client/test", + ] + ] + }) // Test that NormandyApi can fetch from the test server. const response = yield NormandyApi.get("test_server.sjs"); diff --git a/test/test_server.sjs b/test/test_server.sjs index 5cb8eb4db..c9abf9094 100644 --- a/test/test_server.sjs +++ b/test/test_server.sjs @@ -4,5 +4,5 @@ function handleRequest(request, response) { // Avoid confusing cache behaviors response.setHeader("Cache-Control", "no-cache", false); response.setHeader("Content-Type", "application/json", false); - response.write("{\"test\":\"data\"}"); + response.write(JSON.stringify({test: "data"})) }