Skip to content

Commit

Permalink
Merge pull request mozilla#44 from mythmon/test-tweaks
Browse files Browse the repository at this point in the history
Tweak tests to be a little better
  • Loading branch information
Mike Cooper authored Jan 4, 2017
2 parents 4c56e64 + e2d50a7 commit 4dc5be5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions test/browser_NormandyApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion test/test_server.sjs
Original file line number Diff line number Diff line change
Expand Up @@ -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"}))
}

0 comments on commit 4dc5be5

Please sign in to comment.