Repository navigation
docs(skills): fixes from a full setup, test and CI run - #27
Merged
Merged
Conversation
- ci-setup: derive the contract baseUrl from the real mock URLs and check that mocks were validated (#21) - setup: scaffold imports only twd (#22) - setup: run the type-check command once during verification (#23) - setup: detect MockedComponent and offer component mocking for third-party components (#24) - ci-setup: offer to exclude TWD tests from an existing istanbul config (#25) - twd: findBy* for every query, getBy* only inside twd.waitFor (#26)
kevinccbsg
marked this pull request as ready for review
October 15, 2026 18:18
Reuse the variable while the element stays mounted; query again with the expected state when the change is async or the element is replaced.
Component and module mocking is rare; setup reads references/third-party.md only when the project has third-party code to mock.
kevinccbsg
added a commit
to BRIKEV/twd
that referenced
this pull request
Oct 15, 2026
The docs presented getBy and twd.get as equal alternatives to findBy, which leads to flaky tests: TWD runs against a real app that renders asynchronously, so a bare getBy after visit or a click throws in CI. Document one priority order, matching the twd-ai skill (BRIKEV/twd-ai#27): findBy for every lookup, queryBy only for absence, getBy only inside twd.waitFor, twd.get as the last resort. Convert the examples across the docs to follow it.
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.
Fixes found by running
/twd:setup,/twd:twdand/twd:ci-setupend to end on a React + json-server app (courses/test-skill).baseUrl(ci-setup: contract baseUrl default misses absolute mock URLs #21): derive it from the real mock URLs, following constants and keeping the origin for absolute URLs, then confirm mocks were actually validated. As written, it producedMocks validated: 0next to a green "All mocks match". The twd-cli side is contracts: path-only baseUrl never matches absolute mock URLs, and 0 validated reports success twd-cli#44.twd, so the scaffold passesno-unused-vars.<MockedComponent>usage, and ask whether each item is a component (component mocking) or a module (Sinon). All third-party guidance (component vs module, the patterns sections, thebeforeEachlines) moves tosetup/references/third-party.md, read only when the project has third-party code, sosetup/SKILL.mdends up smaller than onmain.findBy*for every lookup,queryBy*for absence,getBy*only insidetwd.waitFor, thentwd.get(CSS selector) as the last resort. All examples intest-api.md,component-testing.md,test-flow-galleryand the setup template now follow it.Closes #21, closes #22, closes #23, closes #24, closes #25, closes #26
Bumps the plugin to 1.3.5 so installed copies pick up the changes.