Skip to content

Commit a24fc8b

Browse files
authored
refactor(ts-plugin): split go-to-definition e2e tests into per-behavior cases (#378)
Each test now owns a minimal fixture and asserts a single behavior, organized by the .d.ts/mapping pattern under test. The previous structure shared one large fixture (5 files, 8+ tokens) across 17 cases inside a single test.each block, which made it brittle to add new behaviors. The new structure has 14 tests grouped into 4 describe blocks: - jumps to the top of a CSS module file (5 tests) - jumps to a local token declaration (3 tests) - transitively resolves a re-export to its source declaration (3 tests) - jumps from a CSS-side @value ... from binding to its source declaration (3 tests) Adds: - setupFixture / getLoc / getRange in e2e-test/test-util/fixture.ts. The API mirrors createIFF and accepts files directly (including tsconfig.json), so each test controls its own config placement. - buildStylesImport / buildTSConfigJSON in packages/ts-plugin/test/builder.ts for building default / namespace import statements and tsconfig.json fixture content. cmkOptions.enabled defaults to true so callers only specify the options that matter for the test.
1 parent 8c7df39 commit a24fc8b

3 files changed

Lines changed: 468 additions & 268 deletions

File tree

0 commit comments

Comments
 (0)