Skip to content

Commit 0fce694

Browse files
committed
small fixes
1 parent 4bc4701 commit 0fce694

7 files changed

+10
-9
lines changed

eslint.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default tseslint.config(
4444
* Webdriver
4545
*/
4646
{
47-
files: ["webdriver-ts/**/*.{js,cjs,ts}"],
47+
files: ["webdriver-ts/src/**/*.{js,cjs,ts}"],
4848
languageOptions: {
4949
parserOptions: { project: ["./webdriver-ts/tsconfig.eslint.json"] },
5050
},
@@ -53,6 +53,7 @@ export default tseslint.config(
5353
"require-await": "error",
5454
"@typescript-eslint/no-floating-promises": "error",
5555
"@typescript-eslint/no-unused-vars": "off",
56+
"prefer-const": "off",
5657
},
5758
},
5859
/**
@@ -83,7 +84,7 @@ export default tseslint.config(
8384
},
8485
},
8586
{
86-
ignores: ["**/node_modules/", "**/dist/", "**/results/", "css/", "**/csv_export.js"],
87+
ignores: ["**/node_modules/", "**/dist/", "**/results/", "css/", "**/csv_export.js", "**/py/"],
8788
},
8889
eslintConfigPrettier
8990
);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build": "echo \"Please use 'npm run rebuild-all' instead\" && exit 1",
1010
"build-prod": "echo \"Please use 'npm run rebuild-all' instead\" && exit 1",
1111
"compile": "echo \"Please use 'npm run rebuild-all' instead\" && exit 1",
12-
"start": "cd server && node index.js",
12+
"start": "cd server && npm start",
1313
"bench": "cd webdriver-ts && cross-env LANG=\"en_US.UTF-8\" node dist/benchmarkRunner.js",
1414
"checkCSP": "cd webdriver-ts && cross-env LANG=\"en_US.UTF-8\" node dist/isCSPCompliant.js",
1515
"results": "cd webdriver-ts && npm run results",

webdriver-ts/src/benchmarkRunner.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ async function main() {
340340
benchmarkOptions.numIterationsForStartupBenchmark = args.count;
341341
}
342342

343-
let allArgs = args._.length <= 2 ? [] : args._.slice(2, args._.length);
343+
let allArgs = args._.length <= 2 ? [] : args._.slice(2);
344344
let frameworkArgument = args.framework ? args.framework : allArgs;
345345
console.log("args", args, "allArgs", allArgs);
346346

webdriver-ts/src/isCSPCompliant.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let benchmarkOptions: BenchmarkOptions = {
3636
allowThrottling: !args.nothrottling,
3737
};
3838

39-
let allArgs = args._.length <= 2 ? [] : args._.slice(2, args._.length);
39+
let allArgs = args._.length <= 2 ? [] : args._.slice(2);
4040

4141
console.log("args.framework", args.framework, !args.framework);
4242

@@ -89,7 +89,7 @@ async function runBench(
8989
cspCheckSucessful = false;
9090
console.log(`CSP test failed for ${runFrameworks[i].fullNameWithKeyedAndVersion} - due to reporting`);
9191
}
92-
if (!cspCheckSucessful != framework.issues.includes((1139))) {
92+
if (cspCheckSucessful == framework.issues.includes((1139))) {
9393
const hint = cspCheckSucessful ? "The flag 1139 should be removed" : "The flag 1139 should be added";
9494
console.log(`ERROR: CSP is incorrectly categorized for ${runFrameworks[i].fullNameWithKeyedAndVersion} . ${hint}`);
9595
cspCheckSucessful = false;

webdriver-ts/src/isKeyed.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ let benchmarkOptions: BenchmarkOptions = {
3939
allowThrottling: !args.nothrottling,
4040
};
4141

42-
let allArgs = args._.length <= 2 ? [] : args._.slice(2, args._.length);
42+
let allArgs = args._.length <= 2 ? [] : args._.slice(2);
4343
let frameworkArgument = args.framework ? args.framework : allArgs;
4444
console.log("args", args, "allArgs", allArgs);
4545

webdriver-ts/src/playwrightAccess.ts

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ function browserPath(benchmarkOptions: BenchmarkOptions) {
9898
} else if (process.platform == "linux") {
9999
return "/usr/bin/google-chrome";
100100
} else if (/^win/i.test(process.platform)) {
101+
// eslint-disable-next-line unicorn/prefer-string-raw
101102
return "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
102103
} else {
103104
throw new Error("Path to Google Chrome executable must be specified");

webdriver-ts/src/puppeteerAccess.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import * as puppeteer from "puppeteer-core";
22
import { Page } from "puppeteer-core";
33
import { BenchmarkOptions, wait } from "./common.js";
4-
import * as fs from "node:fs";
5-
import * as path from "node:path";
64

75
export async function checkElementNotExists(page: Page, selector: string) {
86
let start = Date.now();
@@ -99,6 +97,7 @@ function browserPath(benchmarkOptions: BenchmarkOptions) {
9997
} else if (process.platform == "linux") {
10098
return "google-chrome";
10199
} else if (/^win/i.test(process.platform)) {
100+
// eslint-disable-next-line unicorn/prefer-string-raw
102101
return "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe";
103102
} else {
104103
throw new Error("Path to Google Chrome executable must be specified");

0 commit comments

Comments
 (0)