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

Bug: Argument Parsing Issues with Config, label, and others params #31

Closed
jacobwi opened this issue Mar 17, 2024 · 0 comments · Fixed by #33
Closed

Bug: Argument Parsing Issues with Config, label, and others params #31

jacobwi opened this issue Mar 17, 2024 · 0 comments · Fixed by #33

Comments

@jacobwi
Copy link
Contributor

jacobwi commented Mar 17, 2024

I'm encountering several issues with argument parsing in vscode-test, specifically with the --label, --config, and potentially other parameters. Below are the commands I tried and the unexpected outcomes I observed:

Issues with --label argument:

vscode-test --label main doesn't work
vscode-test -l main doesn't work

Despite having a configuration labeled "main" as shown below, I receive an error stating that a configuration with label "main" could not be found.

import { defineConfig } from '@vscode/test-cli';

export default defineConfig([
  {
    "label": "main",
    files: 'out/test/**/*.test.js', // Pattern to match test files
    version: 'insiders', // Use VS Code Insiders for running tests
    mocha: {
      ui: 'bdd', // Behavior-Driven Development style interface
      timeout: 20000 // Set test timeout to 20 seconds
    }
  }
]);

vscode-test --config .vscode-test.mjs doesn't work
vscode-test --config ./.vscode-test.mjs doesn't work
vscode-test --config ".vscode-test.mjs" doesn't work
vscode-test --config "./.vscode-test.mjs" doesn't work

When attempting to specify the configuration file, various formats of the --config argument lead to failures, either not recognizing the file or not parsing it correctly.

Additional tests:
Using the command "test": "vscode-test --config ./.vscode-test.contextmenu.mjs --label main" also resulted in errors, with the following output:

TypeError: Cannot read properties of undefined (reading 'length')
    at [file path on your system]/enhanced-resolve@5.16.0/node_modules/enhanced-resolve/lib/util/path.js:41:12

This error seems to stem from an issue with path handling within the enhanced-resolve package or potentially within vscode-test's usage of it.

Fixed it and will commit shortly.

jacobwi added a commit to jacobwi/vscode-test-cli that referenced this issue Mar 17, 2024
- Resolved argument parsing issues with `--config` and `--label` options, ensuring proper handling of command-line arguments.
- Applied Prettier formatting across the codebase for consistent coding styles.
- Updated project dependencies to their latest versions for improved security and performance.

These changes enhance the tool's reliability, maintainability, and user experience.

Ref: microsoft#31
jacobwi added a commit to jacobwi/vscode-test-cli that referenced this issue Mar 17, 2024
- Resolved argument parsing issues with `--config` and `--label` options, ensuring proper handling of command-line arguments.
- Applied Prettier formatting across the codebase for consistent coding styles.
- Updated project dependencies to their latest versions for improved security and performance.

These changes enhance the tool's reliability, maintainability, and user experience.

Ref: microsoft#31
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 a pull request may close this issue.

1 participant