Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Scenario Steps report wrong line/column for TypeScript include modules

オープン
#5,772 コメント 0 件 リアクション 1 件 担当者 2 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@kobenguyent がすでに取り組んでいます。

2026年10月31日 から。

  • #5776 @copilot-swe-agent による — オープン

評価

難易度
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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codeceptjs/CodeceptJS のほかの issue

codeceptjs/CodeceptJS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。