Skip to content

Commit

Permalink
fix(testing): add minimal tsconfig, fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoMcA committed Jun 20, 2022
1 parent e586032 commit 97527cb
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions testing/tests/developing.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { test, expect } = require("@playwright/test");
const got = require("got");

export {};

const DEV_BASE_URL =
process.env.DEVELOPING_DEV_BASE_URL || "http://localhost:3000";

Expand Down
2 changes: 2 additions & 0 deletions testing/tests/headless.auth.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { test, expect } = require("@playwright/test");

export {};

function testURL(pathname = "/") {
const PORT = parseInt(process.env.SERVER_PORT || "5042");
return `http://localhost:${PORT}${pathname}`;
Expand Down
2 changes: 2 additions & 0 deletions testing/tests/headless.index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { test, expect } = require("@playwright/test");

export {};

function testURL(pathname = "/") {
const PORT = parseInt(process.env.SERVER_PORT || "5042");
return `http://localhost:${PORT}${pathname}`;
Expand Down
2 changes: 2 additions & 0 deletions testing/tests/headless.search.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { test, expect } = require("@playwright/test");

export {};

function testURL(pathname = "/") {
return "http://localhost:5042" + pathname;
}
Expand Down
2 changes: 2 additions & 0 deletions testing/tests/headless.sitesearch.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const { test, expect } = require("@playwright/test");

export {};

function testURL(pathname = "/") {
return "http://localhost:5042" + pathname;
}
Expand Down
3 changes: 1 addition & 2 deletions testing/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1591,8 +1591,7 @@ test("home page should have a /index.json file with pullRequestsData", () => {
const builtFolder = path.join(buildRoot, "en-us");

const jsonFile = path.join(builtFolder, "index.json");
// @ts-ignore
const { hyData: { recentContributions } = {} } = JSON.parse(
const { hyData: { recentContributions = {} } = {} } = JSON.parse(
fs.readFileSync(jsonFile, "utf-8")
);
expect(recentContributions.items.length).toBeGreaterThan(0);
Expand Down
7 changes: 7 additions & 0 deletions testing/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.json",
"include": ["tests"],
"compilerOptions": {
"noEmit": true
}
}

0 comments on commit 97527cb

Please sign in to comment.