Skip to content

test(remark-lsx): improve prefix extraction test suite#10959

Merged
yuki-takei merged 2 commits into
masterfrom
imprv/181096-improve-prefix-extraction-test-suite
May 15, 2026
Merged

test(remark-lsx): improve prefix extraction test suite#10959
yuki-takei merged 2 commits into
masterfrom
imprv/181096-improve-prefix-extraction-test-suite

Conversation

@NJisEverywhere

@NJisEverywhere NJisEverywhere commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

タスク

https://redmine.weseek.co.jp/issues/181294

背景

#10931 において、$lsx(/foo bar) のような半角スペースを含むページパスが正しく認識されないバグを修正した。その際、テストファイル lsx.spec.ts を新規作成したが、内容はコードコメントの case 1〜4 を写した最低限の回帰テストに留まっていた。

内容

lsx.spec.ts のテスト品質を以下の観点で改善した。

構造の整理

  • case 1case 4 というナンバリング形式から、動作の意図でグループ化した describe ブロックに再構成
  • it.concurrent.each によるテーブル駆動テストを採用し、ケース追加・比較を容易にした

カバレッジの拡充

#10931 では未検証だった以下の観点を追加した。

追加した観点 代表ケース
バグ起票の直接再現シナリオ $lsx(/Official template/お知らせ)'/Official template/お知らせ'
結合の停止条件(非空値) { '/foo': '', '/bar': '', baz: 'qux' }'/foo /bar'
結合の停止条件(空値でも supported 属性は停止) { '/foo': '', depth: '' }'/foo'
prefix=''(空文字)を明示した場合の優先 { prefix: '', '/path': '' }''
prefix がセットされない条件(5ケース) 先頭が supported 属性の場合 など

@miya miya self-assigned this May 12, 2026
@yuki-takei yuki-takei merged commit db0ba77 into master May 15, 2026
33 checks passed
@yuki-takei yuki-takei deleted the imprv/181096-improve-prefix-extraction-test-suite branch May 15, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants