Skip to content

Commit

Permalink
fixing typo
Browse files Browse the repository at this point in the history
  • Loading branch information
beluamat29 committed Dec 2, 2024
1 parent f760173 commit b668ab2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/config/parameters_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { isFailFastParam, isLanguageParam, isRandomizeParam } from '../utils.js'

const LANGUAGE_OPTIONS = ['es', 'en', 'it'];
export class ParametersParser {

static generateRunConfigurationFromParams(params) {
const sanitizedParams = this.sanitizeParameters(params);
return this.generateRunConfigurationFromSanitizedParams(sanitizedParams);
Expand All @@ -20,6 +21,7 @@ export class ParametersParser {

return generatedParams;
}

static #generateRunConfigurationParameter(param) {
const paramParser = [FailFastConfigurationParameterParser, RandomizeConfigurationParameterParser, LanguageConfigurationParameterParser, InvalidConfigurationParameter].find(configurationParameterParser => configurationParameterParser.canHandle(param));
return paramParser.handle(param);
Expand All @@ -43,7 +45,7 @@ export class ParametersParser {
static #validateLanguageOption(params, languageParamIndex) {
const languageOption = params[languageParamIndex + 1];
if (!LANGUAGE_OPTIONS.includes(languageOption)) {
throw Error('Invalid language option. Please choose between an option between es for Spanish, en for English or it for Italian');
throw Error('Invalid language option. Please choose an option between es for Spanish, en for English or it for Italian');
}
return languageOption;
}
Expand Down Expand Up @@ -73,6 +75,7 @@ export class ParametersParser {
}

class FailFastConfigurationParameterParser {

static canHandle(consoleParam) {
return isFailFastParam(consoleParam);
}
Expand All @@ -83,6 +86,7 @@ class FailFastConfigurationParameterParser {
}

class RandomizeConfigurationParameterParser {

static canHandle(consoleParam) {
return isRandomizeParam(consoleParam);
}
Expand All @@ -93,11 +97,13 @@ class RandomizeConfigurationParameterParser {
}

class LanguageConfigurationParameterParser {

static canHandle(consoleParam) {
return isLanguageParam(consoleParam);
}

static handle(consoleParam) {

const options = consoleParam.split(' ');
return { language: options[1] };
}
Expand Down

0 comments on commit b668ab2

Please sign in to comment.