Skip to content

Test the packed lib/ in vp run ci - #4209

Closed
nstepien wants to merge 1 commit into
mainfrom
test-lib
Closed

nstepien wants to merge 1 commit into
mainfrom
test-lib

Conversation

@nstepien

Copy link
Copy Markdown
Collaborator

Tests now import react-data-grid instead of relative src paths, so vp run ci can run them against the packed lib/, which is what we publish.

  • vp test / vp run test alias react-data-grid to src/index.ts with test.alias, so day-to-day testing doesn't need vp pack.
  • vp run ci runs its tests with TEST_LIB=true, which drops the alias and loads lib/styles.css as a setup file. TEST_LIB is in the test task's cache env, so src/ and lib/ results are cached separately.
  • TEST_LIB is separate from CI, so vp run test test/visual --update in the screenshot workflow, which doesn't pack, keeps testing src/. Visual tests are still enabled by CI alone.
  • tsconfig.test.json maps react-data-grid to src/index.ts, since vp run typecheck runs before vp pack.

A few tests still import internal classnames that aren't public (src/style/cell, src/style/row, src/HeaderRow). They compiled with the root ecij() plugin's default css- prefix, while lib/ uses rdg-<version>-, so 63 tests failed against lib/. The root plugin now shares classPrefix with vp pack; as a side effect, the website also gets rdg-<version>- classes.

AGENTS.md notes that vp run ci tests lib/ while vp test tests src/.

Verified locally: vp run ci (544 passed, 3 skipped against lib/) and vp test (544 passed, 3 skipped against src/). Visual tests only run in CI.

🤖 Generated with Claude Code

Tests now import `react-data-grid` instead of relative `src` paths.
`vp test` aliases it to `src/index.ts`, while `vp run ci` sets
`TEST_LIB=true` to test the packed `lib/` and its `styles.css`.

The root `ecij()` plugin now uses the same class prefix as `vp pack`,
so classnames that tests still import from `src/` match `lib/`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.24%. Comparing base (f7d4e27) to head (0af0242).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #4209       +/-   ##
==========================================
- Coverage   98.41%   3.24%   -95.17%     
==========================================
  Files          45      45               
  Lines        1951    1851      -100     
  Branches      727     637       -90     
==========================================
- Hits         1920      60     -1860     
- Misses         31    1791     +1760     

see 43 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nstepien

Copy link
Copy Markdown
Collaborator Author

Cool idea, but it doesn't work well with code coverage

@nstepien nstepien closed this Oct 20, 2026
@nstepien
nstepien deleted the test-lib branch October 20, 2026 00:34
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