Closed mcous closed 6 months ago
@yanick let me know if you think this is too much to change in one PR; I can split it up into a few separate changes relatively trivially
10-4, will undraft this PR when corresponding docs PR is up
Docs PR up at testing-library/testing-library-docs#1369
Giving this one last smoke test in a real-life suite, will update here with results
Passed our ~1000 test suite without any unexpected failures (still on Svelte v4). Had exactly one failure: a test that was using rerender
and relying on the old synchronous destroy and remount behavior. Fixing this test, in turn, uncovered an issue with the type definitions for rerender
- in reality, it accepts Partial<Props>
, not Props
.
Switching the the new await rerender(...)
fixed the test, and I just pushed the type definitions fix, so I think we're all good here if CI agrees with me
@mcous I tried to merge your branch with the head of next on #331 I think I got it all?
@yanick thanks for the assist. I squashed and rebased this branch while referencing #331, which was a little easier on my brain. It looked like 331 added has a few duplicate test cases, but otherwise I mostly followed the changes there
@yanick heads up, looks like semantic release missed this:
[2:54:51 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ Analyzing commit: fix!: align `target` and `baseElement` options with testing-library (#325)
Fixes #312, fixes #313
BREAKING CHANGES: The `container` option has been renamed to `baseElement`,
`result.container` is now set to `target` rather than `baseElement`,
and `render` will now throw if you mix props with the `target` option.
[2:54:51 PM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ The commit should not trigger a release
Suspected causes:
!
as a breaking change in fix!: ...
, so it didn't see fix
nor that it was a major bumpBREAKING CHANGES:
instead of BREAKING CHANGE:
in the footer, so it also missed the major bump hereNot sure the best way to fix this up, the quickest / easiest might be a little distasteful history rewrite on next
:tada: This PR is included in version 4.2.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Fixes #312, fixes #313
BREAKING CHANGES: The
container
option has been renamed tobaseElement
,result.container
is now set totarget
rather thanbaseElement
, andrender
will now throw if you mix props with thetarget
option.Change log
renderOptions.container
torenderOptions.baseElement
baseElement
asresult.baseElement
baseElement
tocomponentOptions.target
if used, elsedocument.body
componentOptions.target
asresult.container
, which is one layer lower in the DOM than the previous behavior and matches othertesting-library
frameworkscomponentOptions.target
will now trigger an error if it is mixed with props, matching the behavior of other component options