[Features][test-lib] Add message arg to the check function
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 50/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- shell, typescript
- Domain
- testing-qa
Research direction
Start with src/spec-node/featuresCLI/utils.ts#L75-L91 and inspect how the check function is called by existing feature tests. Define how the optional message is distinguished from the command arguments, preserve the current calling form, and verify that failed checks display the supplied message.
Written by the indexing model from the issue text.
Description
I would like to propose a change to the check function of the dev-container-features-test-lib script.
The function should take a message to display when the test fails, like other testing frameworks have.
The current function code is:
https://github.com/devcontainers/cli/blob/c246645f97fba402c3b1b95983e573e92bcec464/src/spec-node/featuresCLI/utils.ts#L75-L91
I propose to add a message on $2 or the last argument.
Any thoughts on this?
I would suggest something like this:
check() {
LABEL=$1
MESSAGE = $2 or ${!#}
#
# the rest of the function
#
}
The new function should work like the examples below, and be backwards compatible
old:
check "java version LTS installed as default" \
grep "LTS" <(java --version)
new:
check "java version LTS installed as default" \
grep "LTS" <(java --version) \
"REASON: The installed version is: $(java --version)"
or
check "java version LTS installed as default" \
"REASON: The installed version is: $(java --version)" \
grep "LTS" <(java --version)
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 461
- Avg merge
- 18m
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from devcontainers/cli
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
devcontainers/cli#1203 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
devcontainers/cli#1178 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
devcontainers/cli#1308 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
devcontainers/cli#1307 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
devcontainers/cli#1305 ·
All issues in devcontainers/cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fil-donadoni/tolaria#4409 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
corsairdev/corsair#1764 ·