test(remark-lsx): improve prefix extraction test suite#10959
Merged
yuki-takei merged 2 commits intoMay 15, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
タスク
https://redmine.weseek.co.jp/issues/181294
背景
#10931 において、
$lsx(/foo bar)のような半角スペースを含むページパスが正しく認識されないバグを修正した。その際、テストファイルlsx.spec.tsを新規作成したが、内容はコードコメントの case 1〜4 を写した最低限の回帰テストに留まっていた。内容
lsx.spec.tsのテスト品質を以下の観点で改善した。構造の整理
case 1〜case 4というナンバリング形式から、動作の意図でグループ化したdescribeブロックに再構成it.concurrent.eachによるテーブル駆動テストを採用し、ケース追加・比較を容易にしたカバレッジの拡充
#10931 では未検証だった以下の観点を追加した。
$lsx(/Official template/お知らせ)→'/Official template/お知らせ'{ '/foo': '', '/bar': '', baz: 'qux' }→'/foo /bar'{ '/foo': '', depth: '' }→'/foo'prefix=''(空文字)を明示した場合の優先{ prefix: '', '/path': '' }→''