Test linting behavior in integration (close to real world)#82
Merged
Conversation
8f14f75 to
1442a6c
Compare
test: ensure we validate linting in real world setup (no mocking)
There was a problem hiding this comment.
Pull request overview
This PR aims to test CodeMirror linting behavior in a more integration-like (“real user”) way, validating that linting triggers correctly on initial render and after value updates.
Changes:
- Update lint-related tests to assert on actual diagnostics arrays and add integration-style lint trigger tests.
- Introduce a
lintevent onFeelEditor(backed by a newmittevent emitter) and wire existingonLintthrough it. - Bump several CodeMirror dependencies, add
mitt, and replacekarma-chrome-launcherwithkarma-chrome-launcher-2.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| test/spec/CodeEditor.spec.js | Updates lint assertions to use diagnostics arrays; adds integration-style tests for lint triggering and new lint helpers. |
| src/index.js | Adds an internal event emitter and exposes on/off; emits lint events and forwards them to the existing onLint callback. |
| package.json | Updates dependencies (CodeMirror patches), adds mitt, and switches to karma-chrome-launcher-2. |
| package-lock.json | Locks updated dependency graph reflecting the package.json changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
Released in v2.4.0. I also updated the readme to reflect new API: https://github.com/bpmn-io/feel-editor?tab=readme-ov-file#events |
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.
Proposed Changes
We previously did not test editor linting behavior during value changes. We also did not use the standard "batteries included" by codemirror, but took a (faster) shortcut to force linting. That works "for tests", but does not verify actual user behavior.
This PR adds some real-world tests, to validate linting works as expected across the use-cases we cover.
Checklist
Ensure you provide everything we need to review your contribution:
Closes {LINK_TO_ISSUE}orRelated to {LINK_TO_ISSUE}@bpmn-io/srtool