forked from mozilla/ping-centre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
endpoints.js
25 lines (21 loc) · 1010 Bytes
/
endpoints.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* global assert */
"use strict";
const topic = "sample";
describe("Ping Centre Endpoints", function() {
it("default endpoint is used by default", function() {
const PingCentre = require("../ping-centre");
const pingClient = new PingCentre(topic);
assert.equal(pingClient._pingEndpoint, "https://onyx_tiles.stage.mozaws.net/v3/links/ping-centre");
});
it("prod endpoint is used when prod environment variable is set", function() {
// Clear cache for ping-centre and config since ping-centre needs to be
// required again in order to require config again and look up the
// newly set environment variables.
delete require.cache[require.resolve("../ping-centre")];
delete require.cache[require.resolve("../config")];
process.env["NODE_ENV"] = "production";
const PingCentre = require("../ping-centre");
const pingClient = new PingCentre(topic);
assert.equal(pingClient._pingEndpoint, "https://tiles.services.mozilla.com/v3/links/ping-centre");
});
});