Skip to content

test(desktop): remove redundant muyajs-engine unit specs (Phase F) - #4422

Merged
Jocs merged 1 commit into
developfrom
test/desktop-remove-redundant-engine-specs
Jun 9, 2026
Merged

Jocs merged 1 commit into
developfrom
test/desktop-remove-redundant-engine-specs

Conversation

@Jocs

@Jocs Jocs commented Jun 9, 2026

Copy link
Copy Markdown
Member

What (Phase F1/F3)

Removes 8 desktop unit specs that import the legacy muya/lib (muyajs) alias and test engine markdown/slug/word behavior @muyajs/core now owns and covers with its own suites:

removed spec covered in @muyajs/core by
markdown-basic, list-indentation, nested-mixed-lists, export-markdown commonmark.spec + gfm.spec + roundTrip.spec (conformance)
markdown-footnotes footnote.spec / footnoteHtml.spec
markdown-strong-cjk strongCjkFlanking.spec (#4401)
slugger generateGithubSlug (getTOC.spec)
extract-word replaceCurrentWord.spec + current-word logic

They exercise code the app no longer runs and would break when packages/muyajs is deleted in Phase H. Desktop-specific specs (i18n, match-electron-accelerator, native-theme) are kept.

Phase F status

  • F4 (e2e ag-→mu- selectors): done — no muya-DOM ag- selectors remain; the lone .ag-dialog-table in paragraph-blocks.spec.ts is the desktop's own table dialog (with .el-overlay fallback). The muya/lib mentions in crash-* e2e specs are historical comments only.

Part of the muyajs → @muyajs/core migration.

These 8 specs import the legacy `muya/lib` (muyajs) alias and exercise
engine-level markdown / slug / word-extraction behavior that @muyajs/core
now owns and covers with its own suites:
  - markdown-basic / list-indentation / nested-mixed-lists / export-markdown
    -> muya commonmark.spec + gfm.spec + roundTrip.spec conformance
  - markdown-footnotes -> muya footnote.spec / footnoteHtml.spec
  - markdown-strong-cjk -> muya strongCjkFlanking.spec (#4401)
  - slugger -> muya generateGithubSlug (getTOC.spec)
  - extract-word -> muya replaceCurrentWord.spec + current-word logic

They test code the app no longer uses (the muyajs engine) and would break
when packages/muyajs is removed in Phase H. Desktop-specific unit specs
(i18n, match-electron-accelerator, native-theme) are kept.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings June 9, 2026 01:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the desktop → @muyajs/core migration by removing desktop unit specs that exercised the legacy muya/lib (muyajs) engine behavior which is now owned and covered by packages/muya test suites.

Changes:

  • Removed desktop unit specs for markdown parsing/round-tripping (basic markdown, list indentation, nested mixed lists).
  • Removed desktop unit specs for legacy marked/muya utilities (footnotes lexer, slugger, export-markdown table normalization).
  • Removed desktop unit spec for legacy spellchecker word extraction.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/desktop/test/unit/specs/slugger.spec.ts Removed legacy muya/lib slugger unit spec now covered by @muyajs/core slug/TOC tests.
packages/desktop/test/unit/specs/markdown-strong-cjk.spec.ts Removed legacy inline tokenizer CJK-strong spec now covered by @muyajs/core strong CJK flanking suite.
packages/desktop/test/unit/specs/markdown-nested-mixed-lists.spec.ts Removed legacy nested mixed lists regression spec now covered by @muyajs/core list/state round-trip tests.
packages/desktop/test/unit/specs/markdown-list-indentation.spec.ts Removed legacy list indentation matrix spec now covered by @muyajs/core list serialization tests.
packages/desktop/test/unit/specs/markdown-footnotes.spec.ts Removed legacy footnotes lexer spec now covered by @muyajs/core marked footnote extension + render/state tests.
packages/desktop/test/unit/specs/markdown-basic.spec.ts Removed legacy markdown round-trip specs now covered by @muyajs/core conformance/round-trip suites.
packages/desktop/test/unit/specs/extract-word.spec.ts Removed legacy extractWord spec now covered by @muyajs/core current-word / replaceCurrentWord coverage.
packages/desktop/test/unit/specs/export-markdown.spec.ts Removed legacy ExportMarkdown.normalizeTable spec now covered by @muyajs/core table serialization regression tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Jocs
Jocs merged commit b4428b3 into develop Jun 9, 2026
10 checks passed
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Build artifacts for PR #4422:

Run: https://github.com/marktext/marktext/actions/runs/27177118768

Artifact Size Link
marktext-windows-arm64 256.2 MB Download
marktext-linux 556.4 MB Download
marktext-macos-x64 256.8 MB Download
marktext-windows-x64 257.5 MB Download
marktext-macos-arm64 246.6 MB Download

@Jocs
Jocs deleted the test/desktop-remove-redundant-engine-specs branch June 10, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants