Skip to content

Commit c7d3b89

Browse files
committed
Linting for E2E tests
1 parent 6480667 commit c7d3b89

File tree

5 files changed

+30
-11
lines changed

5 files changed

+30
-11
lines changed

apps/e2e/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"type": "module",
66
"scripts": {
77
"test:watch": "dotenv -c development -- vitest watch",
8-
"test": "dotenv -c development -- vitest run"
8+
"test": "dotenv -c development -- vitest run",
9+
"lint": "eslint --ext .tsx,.ts .",
10+
"clean": "rimraf dist && rimraf node_modules"
911
},
1012
"dependencies": {},
1113
"devDependencies": {

apps/e2e/tests/api/internal-project.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const AUTH_HEADER = {
1010

1111
const JSON_HEADER = {
1212
"content-type": "application/json"
13-
}
13+
};
1414

1515
function randomString() {
1616
return crypto.randomBytes(16).toString("hex");
@@ -48,8 +48,8 @@ describe("Various internal project tests", () => {
4848
const response = await request(BASE_URL).get("/api/v1");
4949
console.log(response);
5050
expect(response.status).toBe(200);
51-
expect(response.text).contains("Stack API")
52-
expect(response.text).contains("Authentication: None")
51+
expect(response.text).contains("Stack API");
52+
expect(response.text).contains("Authentication: None");
5353
});
5454

5555
test("Credential sign up", async () => {
@@ -84,7 +84,7 @@ describe("Various internal project tests", () => {
8484
'authorization': 'StackSession ' + response.body.accessToken,
8585
});
8686
expect(response2.status).toBe(200);
87-
expect(response2.body.primaryEmail).toBe(email)
87+
expect(response2.body.primaryEmail).toBe(email);
8888
});
8989

9090
test("Can't get current user with invalid token", async () => {

apps/e2e/tests/helpers.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
function getEnvVar(name: string): string {
2-
const value = process.env[name]
2+
const value = process.env[name];
33
if (!value) {
4-
throw new Error(`Missing environment variable: ${name}`)
4+
throw new Error(`Missing environment variable: ${name}`);
55
}
6-
return value
6+
return value;
77
}
88

9-
export const BASE_URL = getEnvVar("SERVER_BASE_URL")
10-
export const INTERNAL_PROJECT_ID = getEnvVar("INTERNAL_PROJECT_ID")
11-
export const INTERNAL_PROJECT_CLIENT_KEY = getEnvVar("INTERNAL_PROJECT_CLIENT_KEY")
9+
export const BASE_URL = getEnvVar("SERVER_BASE_URL");
10+
export const INTERNAL_PROJECT_ID = getEnvVar("INTERNAL_PROJECT_ID");
11+
export const INTERNAL_PROJECT_CLIENT_KEY = getEnvVar("INTERNAL_PROJECT_CLIENT_KEY");

apps/e2e/tsconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"compilerOptions": {
3+
"jsx": "react-jsx",
4+
"outDir": "dist",
5+
"rootDir": "tests",
6+
"declaration": true,
7+
"target": "ESNext",
8+
"module": "NodeNext",
9+
"moduleResolution": "NodeNext",
10+
"esModuleInterop": true,
11+
"noErrorTruncation": true,
12+
"strict": true,
13+
"skipLibCheck": true
14+
},
15+
"include": ["tests/**/*"],
16+
"exclude": ["node_modules", "dist"]
17+
}

0 commit comments

Comments
 (0)