Scenario Steps report wrong line/column for TypeScript include modules
Los mantenedores suelen responder en 2 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript
- Área
- testing
Línea de trabajo
Start by reading the code that rewrites .temp.mjs paths for Scenario Steps and the sandbox runner tests mentioned in the issue. Reproduce with the supplied TypeScript include example, then add a test asserting I.doThing points to fooPage.ts:6:5 while the test-file step remains correct. Done when reported source line and column match the TypeScript file.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Scenario Steps report wrong line/column for TypeScript include modules (after path fix)
Summary
After #5685 (current releases / latest on npm), Scenario Steps for TypeScript include modules show the correct .ts path, but line/column still come from the transpiled .temp.mjs, not the source file. Steps in test files report correct lines.
Related: #5675 (closed), #5685 (merged).
Expected vs actual
pages/fooPage.ts — I.doThing is on line 6:
Expected: ✔ I.doThing("...") at Object.open (./pages/fooPage.ts:6:5)
Actual: ✔ I.doThing("...") at Object.open (./pages/fooPage.ts:4:11)
In the same scenario, the test-file step is the control (correct line):
✖ I.failNow("deliberate failure so Scenario Steps is printed") at Test.<anonymous> (./tests/fooTest.ts:5:5)
Repro (browser-free)
codecept.conf.js:
export const config = {
tests: './tests/fooTest.ts',
output: './output',
helpers: {
FakeHelper: { require: './fakeHelper.js' },
},
include: { fooPage: './pages/fooPage.ts' },
require: ['tsx/cjs'],
name: 'ts-step-paths-repro',
};
fakeHelper.js:
import Helper from 'codeceptjs/lib/helper';
export default class FakeHelper extends Helper {
doThing(label) {
return label;
}
failNow(message) {
throw new Error(message);
}
}
pages/fooPage.ts:
export {};
const { I } = inject();
export default {
open() {
I.doThing('called from a .ts page object under include');
},
};
tests/fooTest.ts:
Feature('ts step paths');
Scenario('reports page object step path', ({ I, fooPage }) => {
fooPage.open();
I.failNow('deliberate failure so Scenario Steps is printed');
});
cd <repro-directory>
npm install codeceptjs@latest tsx typescript
npx codeceptjs run -c codecept.conf.js
Install codeceptjs, tsx, and typescript in one command. Check Scenario Steps for the I.doThing line.
| Location | Expected (source) | Reported (latest) |
|---|---|---|
I.doThing in pages/fooPage.ts |
./pages/fooPage.ts:6:5 |
./pages/fooPage.ts:4:11 |
I.failNow in tests/fooTest.ts |
./tests/fooTest.ts:5:5 |
./tests/fooTest.ts:5:5 ✓ |
Environment
- CodeceptJS latest on npm (reproduced on 4.2.2)
- Node 26.x, macOS
require: ['tsx/cjs']
Suggested fix
Remap line/column when rewriting .temp.mjs → .ts (source maps or equivalent), and add a sandbox runner test that asserts source line/col for an included page object step.
- Lenguaje dominante
- JavaScript
- Estrellas
- 4.2k
- Forks
- 754
- Merge medio
- 2 d 6 h
- PR fusionados (30 d)
- 33
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la 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
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
codeceptjs/CodeceptJS#5773 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
`I.waitForFile` (FileSystem helper) fails if directory does not exist (yet)Posiblemente ocupada @danielrentz la tomó hace 275 días. Abiertostale
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
codeceptjs/CodeceptJS#5420 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
stale
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
codeceptjs/CodeceptJS#4958 · 10 comentarios · 2 reacciones ·
Los mantenedores suelen responder en 2 días
-
stale
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
codeceptjs/CodeceptJS#4778 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
run-workers --by pool: failing Before after auth `loginAs()` hangs the worker; remaining tests never runPosiblemente ocupada @DenysKuchma la tomó hace 4 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
codeceptjs/CodeceptJS#5769 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de codeceptjs/CodeceptJS
Issues similares
-
Let TypeScript accept an initial object in ReactiveDictPosiblemente ocupada @yograj-vijay-yadav la tomó hoy. Abiertobug good first issue help wanted workshop
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
meteor/meteor#14919 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
akitaonrails/FrankMD#268 ·
Los mantenedores suelen responder en 1 día
-
account: profile
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 5 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
mfreed7/xslt_polyfill#65 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día