From 8cab9a3eb68eca2c490948e96a2f4e35a7f61b36 Mon Sep 17 00:00:00 2001 From: "Mx. Corey Frang" Date: Thu, 9 Nov 2023 16:00:28 -0500 Subject: [PATCH] fix reassigning id (let instead of const) --- src/agent/driver-test-runner.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/agent/driver-test-runner.js b/src/agent/driver-test-runner.js index 17c2b56..e982b79 100644 --- a/src/agent/driver-test-runner.js +++ b/src/agent/driver-test-runner.js @@ -197,7 +197,9 @@ export class DriverTestRunner { export function validateKeysFromCommand(command) { const errors = []; - for (const { id } of command.keypresses) { + for (let { id } of command.keypresses) { + // PAGE_DOWN and PAGE_UP are the only commands that have the extra _ inside a key + id = id.replace(/(PAGE)_(DOWN|UP)/, '$1$2'); if (/\//.test(id)) { errors.push(`'${id}' cannot contain '/'.`); } @@ -210,7 +212,6 @@ export function validateKeysFromCommand(command) { if (/\bfollowed\b/.test(id)) { errors.push(`'${id}' cannot contain 'followed' or 'followed by'.`); } - id = id.replace(/(PAGE)_(DOWN|UP)/, '$1$2'); for (const part of id.split('_')) { // Some old test plans have keys that contain indications of unspecified // instructions ('/') or additional instructions that are not standardized