devcontainers / devcontainers/cli

test: findUserArg has no unit tests

Open Beginner friendly
#1,178 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3k
Forks
457
Avg merge
13h 17m
Merged PRs (30d)
6

Description

`findUserArg` in `singleContainer.ts` is exported but has no test coverage.
No test file currently imports from `singleContainer`.

Proposing to add `src/test/singleContainer.test.ts` covering these cases:
- ['-u', 'myuser'] -> 'myuser'
- ['--user', 'myuser'] -> 'myuser'
- ['--user=myuser'] -> 'myuser'
- ['--user', 'a', '-u', 'b'] -> 'b' (last wins)
- [] -> undefined

Would this be helpful?

Contributor guide

Open the contributing guide

Research direction

Start by reading findUserArg in singleContainer.ts and reviewing nearby test conventions. Add src/test/singleContainer.test.ts for the five listed argument cases, then run that test file using the repository's existing test command. Done means each expected username or undefined result is covered and passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing-qa
Issue type
Refactor
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.