Silent Failures of Assertions When Using --grep with Full Feature-Scenario Name
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 52/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- javascript, node.js, typescript
Línea de trabajo
Reproduzca el problema con el Feature/Scenario Outline y la definición de pasos en .steps.ts, comparando npx codeceptjs run --grep "Featurename: Scenarioname" con el comando que ejecuta solo el escenario. Empiece por el manejo de --grep de la CLI y siga cómo la coincidencia completa de feature-escenario ejecuta las assertions y registra los resultados. Se considera terminado cuando las assertions fallidas se notifican correctamente y la ejecución ya no muestra un OK | 0 passed engañoso.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
I am encountering an issue when running specific scenarios with the --grep flag. Specifically, when using npx codeceptjs run --grep "Featurename: Scenarioname", node assertions like assert.equal(1,2) are not being processed correctly and test failures are silent. However, running the same test with npx codeceptjs run --grep "Scenarioname" works as expected. Since a couple of versions CodeceptJS gives the first command as a suggestion if no matching scenario was found for a test run:
No tests found by pattern: /Featurename: Scenarioname_misspelled/
Maybe you wanted to run one of these tests?
...
To run the first test use the following command:
npx codeceptjs run --debug --grep "Featurename: Scenarioname "
This issue leads to assertions seemingly passing, and the test run result shows a green OK | 0 passed, despite a failure condition and the test run itself being aborted correctly.
If a pattern is suggested for use, it should work as expected and handle failing assertions correctly, which in this case it does not.
Steps to Reproduce
- Define a Feature and Scenario Outline in a .feature file
- Add a step definition for the Scenario that contains a false node assertion in a .steps.ts file
- Run CodeceptJS with the full feature-scenario name as a filter:
npx codeceptjs run --grep "Featurename: Scenarioname"
If the assertion evaluates to a failure the test will silently pass, and the terminal will showOK | 0 passedeven if the whole test should have failed. - If the same test is run with just the scenario name filter:
npx codeceptjs run --grep "Scenarioname"
The test executes correctly, fails and printsFAIL | 0 passed, 1 failed.
Code Example
Feature File:
Feature: Billing
As a user, I want to do billing calculations.
Scenario Outline: Monthly <usecase>
Given I am on page billing
When I settle the bill
Then I see that the number of billed items <billedItems> is correct
Examples:
| usecase | dateFrom | dateTo | billedItems |
| Normal | 2023-01-01| 2023-01-31 | 10 |
Step Definition:
import assert from "node:assert"
....
Then("I see that the number of billed items {int} is correct", async (billedItems: number) => {
assert.equal(billedItems, 10); // Example check, should fail if numbers don't match
})
Expected Behavior
When running npx codeceptjs run --grep "Featurename: Scenarioname", the assertions should execute, and any failures should be properly tracked and printed by CodeceptJS.
The output should show either 1 failed or 1 passed, depending on the assertion and should not silently fail with 0 passed.
Environment
CodeceptJS version: 3.7.8
Node.js version: v25.9.0
- Lenguaje dominante
- JavaScript
- Estrellas
- 4.2k
- Forks
- 756
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 16
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de codeceptjs/CodeceptJS
-
stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
codeceptjs/CodeceptJS#5420 · 1 comentario ·
-
stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
codeceptjs/CodeceptJS#5358 · 1 comentario ·
-
stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
codeceptjs/CodeceptJS#4958 · 10 comentarios · 2 reacciones ·
-
stale
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
codeceptjs/CodeceptJS#4778 · 3 comentarios ·
-
stale
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
codeceptjs/CodeceptJS#5618 · 1 comentario ·
Todos los issues de codeceptjs/CodeceptJS
Issues similares
-
curation good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
amponce/archive-movie-browser#186 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
clerk/javascript#9852 ·
-
bug p1 tools
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
HarperFast/skills#96 ·
-
factory-active factory-automatic task-bug-reproduction-cannot-reproduce task-identify-harness-labels-done task-identify-issue-type-done
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100