Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for configuring k6-jslib-testing via the environment #9

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

oleiade
Copy link
Member

@oleiade oleiade commented Feb 4, 2025

Introduces support for the K6_TESTING_COLORIZE, K6_TESTING_DISPLAY, K6_TESTING_TIMEOUT and K6_TESTING_INTERVAL environment variables to configure the expect keyword accordingly. Precedence, from higher to lower is env > js configure call > defaults.

See README for documentation.

@oleiade oleiade requested a review from Copilot February 4, 2025 14:51
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • README.md: Evaluated as low risk
  • environment.ts: Evaluated as low risk

test_helpers.ts Show resolved Hide resolved
@oleiade oleiade requested a review from Copilot February 4, 2025 14:54

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • README.md: Evaluated as low risk
  • config.test.ts: Evaluated as low risk
Comments suppressed due to low confidence (2)

environment.ts:54

  • The enum function converts the environment variable value to lowercase, which may not be intended if the environment variables are case-sensitive. Consider removing the .toLowerCase() conversion.
const value = env[key]?.toLowerCase() as T;

environment.ts:87

  • [nitpick] The error message should be more specific about the requirement for a non-negative number. Consider changing it to: Environment variable ${name} must be a non-negative number (>= 0), got: ${value}.
throw new Error(`Environment variable ${name} must be a non-negative number, got: ${value}`);
@oleiade oleiade merged commit 34ecbb6 into main Feb 4, 2025
3 checks passed
@oleiade oleiade deleted the feature/env-configuration branch February 4, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant