Scenario Steps report wrong line/column for TypeScript include modules
维护者通常 1 天内回复
@kobenguyent 已经在做这个了。
开始于 2026年10月31日。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- node.js, typescript
- 领域
- testing
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- JavaScript
- 星标
- 4.2k
- 派生
- 754
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 28
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codeceptjs/CodeceptJS 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
codeceptjs/CodeceptJS#5773 · 1 条评论 ·
维护者通常 1 天内回复
-
`I.waitForFile` (FileSystem helper) fails if directory does not exist (yet)可能已有人在做 @danielrentz 于 278 天前认领。 未关闭stale
难度 2/5 1-3 小时 新手友好度 72/100
codeceptjs/CodeceptJS#5420 · 1 条评论 ·
维护者通常 1 天内回复
-
stale
难度 2/5 1-3 小时 新手友好度 78/100
codeceptjs/CodeceptJS#4958 · 10 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
stale
难度 1/5 1 小时以内 新手友好度 72/100
codeceptjs/CodeceptJS#4778 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 12/100
codeceptjs/CodeceptJS#5783 ·
维护者通常 1 天内回复
查看 codeceptjs/CodeceptJS 的全部 Issue
相似的 Issue
-
check:failed feeds:add
难度 2/5 1-3 小时 新手友好度 65/100
iptv-org/database#38938 · 2 条评论 ·
维护者通常 4 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
rescript-lang/rescript#9182 ·
维护者通常 1 天内回复
-
Analysis
难度 2/5 1-3 小时 新手友好度 72/100
SACGF/variantgrid#2615 ·
维护者通常 1 天内回复
-
curriculum documentation quality
难度 2/5 1-3 小时 新手友好度 72/100
githubnext/gh-aw-workshop#5297 ·
维护者通常 1 天内回复