mirror of https://github.com/zulip/zulip.git
web/tests: Don’t rely on current directory.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
d8adc6de1c
commit
23fd4f95f4
|
@ -2,6 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const {JSDOM} = require("jsdom");
|
||||
|
||||
|
@ -9,7 +10,10 @@ const {mock_esm, set_global, zrequire} = require("./lib/namespace");
|
|||
const {run_test} = require("./lib/test");
|
||||
const $ = require("./lib/zjquery");
|
||||
|
||||
const template = fs.readFileSync("templates/corporate/billing.html", "utf8");
|
||||
const template = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../templates/corporate/billing.html"),
|
||||
"utf8",
|
||||
);
|
||||
const dom = new JSDOM(template, {pretendToBeVisual: true});
|
||||
const document = dom.window.document;
|
||||
const location = set_global("location", {});
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const {JSDOM} = require("jsdom");
|
||||
|
||||
|
@ -11,7 +12,10 @@ const {run_test} = require("./lib/test");
|
|||
const $ = require("./lib/zjquery");
|
||||
const {page_params} = require("./lib/zpage_params");
|
||||
|
||||
const template = fs.readFileSync("templates/corporate/upgrade.html", "utf8");
|
||||
const template = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../templates/corporate/upgrade.html"),
|
||||
"utf8",
|
||||
);
|
||||
const dom = new JSDOM(template, {
|
||||
pretendToBeVisual: true,
|
||||
url: "http://zulip.zulipdev.com/upgrade/#billing",
|
||||
|
|
|
@ -34,6 +34,7 @@ require("@babel/register")({
|
|||
"babel-plugin-rewire-ts",
|
||||
["@babel/plugin-transform-modules-commonjs", {lazy: () => true}],
|
||||
],
|
||||
root: path.resolve(__dirname, "../../.."),
|
||||
});
|
||||
|
||||
// Create a helper function to avoid sneaky delays in tests.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const {JSDOM} = require("jsdom");
|
||||
|
||||
|
@ -9,7 +10,10 @@ const {zrequire} = require("./lib/namespace");
|
|||
const {run_test} = require("./lib/test");
|
||||
const $ = require("./lib/zjquery");
|
||||
|
||||
const template = fs.readFileSync("templates/analytics/realm_details.html", "utf8");
|
||||
const template = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../templates/analytics/realm_details.html"),
|
||||
"utf8",
|
||||
);
|
||||
const dom = new JSDOM(template, {pretendToBeVisual: true});
|
||||
const document = dom.window.document;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const {JSDOM} = require("jsdom");
|
||||
|
||||
|
@ -11,7 +12,10 @@ const $ = require("./lib/zjquery");
|
|||
const {page_params} = require("./lib/zpage_params");
|
||||
|
||||
const noop = () => {};
|
||||
const template = fs.readFileSync("templates/corporate/upgrade.html", "utf8");
|
||||
const template = fs.readFileSync(
|
||||
path.resolve(__dirname, "../../templates/corporate/upgrade.html"),
|
||||
"utf8",
|
||||
);
|
||||
const dom = new JSDOM(template, {pretendToBeVisual: true});
|
||||
const document = dom.window.document;
|
||||
const location = set_global("location", {});
|
||||
|
|
Loading…
Reference in New Issue