Skip to content

Commit

Permalink
fix reassigning id (let instead of const)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarf committed Nov 9, 2023
1 parent 9637e15 commit 8cab9a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/agent/driver-test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '/'.`);
}
Expand All @@ -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
Expand Down

0 comments on commit 8cab9a3

Please sign in to comment.