Scenario Steps report wrong line/column for TypeScript include modules
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 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
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 33
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codeceptjs/CodeceptJS のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
codeceptjs/CodeceptJS#5773 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
`I.waitForFile` (FileSystem helper) fails if directory does not exist (yet)対応中かも @danielrentz が 275 日前に担当しました。 オープンstale
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
codeceptjs/CodeceptJS#5420 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
stale
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
codeceptjs/CodeceptJS#4958 · コメント 10 件 · リアクション 2 件 ·
メンテナーはふだん 2 日以内に返信
-
stale
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
codeceptjs/CodeceptJS#4778 · コメント 3 件 ·
メンテナーはふだん 2 日以内に返信
-
run-workers --by pool: failing Before after auth `loginAs()` hangs the worker; remaining tests never run対応中かも @DenysKuchma が 4 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
codeceptjs/CodeceptJS#5769 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
codeceptjs/CodeceptJS の issue をすべて見る
似ている issue
-
Let TypeScript accept an initial object in ReactiveDict対応中かも @yograj-vijay-yadav が今日担当しました。 オープンbug good first issue help wanted workshop
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
meteor/meteor#14919 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
akitaonrails/FrankMD#268 ·
メンテナーはふだん 1 日以内に返信
-
account: profile
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 5 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
mfreed7/xslt_polyfill#65 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信