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.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
pleasantest@3.0.0
Major Changes
#561
b565e0b
Thanks @calebeby! - Normalize whitespace in element accessible names ingetAccessibilityTree
. Markup with elements which have an accessible name that includes irregular whitespace, like non-breaking spaces, will now have a different output forgetAccessibilityTree
snapshots. Previously, the whitespace was included, now, whitespace is replaced with a single space.#535
dc6f81c
Thanks @calebeby! - Values exported fromrunJS
are now available in Node.For example:
We've also introduced a utility function to make it easier to call
JSHandle
s that point to functions,makeCallableJSHandle
. This function takes aJSHandle<Function>
and returns a node function that calls the corresponding browser function, passing along the parameters, and returning the return value wrapped inPromise<JSHandle<T>>
:For TypeScript users,
runJS
now accepts a new optional type parameter, to specify the exported types of the in-browser module that is passed in. The default value for this parameter isRecord<string, unknown>
(an object with string properties and unknown values). Note that this type does not includeJSHandles
, those are wrapped in the return type fromrunJS
automatically.Using the first example, the optional type would be:
Now
focusTarget
automatically has the typeJSHandle<Element>
andfavoriteNumber
automatically has the typeJSHandle<number>
. Without passing in the type parameter torunJS
, their types would both beJSHandle<unknown>
.#541
39085ac
Thanks @calebeby! -injectHTML
now executes script tags in the injected markup by default. This can be disabled by passing theexecuteScriptTags: false
option as the second parameter.For example, the script tag is now executed by default:
But by passing
executeScriptTags: false
, we can disable execution:#535
dc6f81c
Thanks @calebeby! - The way thatrunJS
receives parameters in the browser has changed. Now, parameters are available asimport.meta.pleasantestArgs
instead of through an automatically-called default export.For example, code that used to work like this:
Now should be written like this:
This is a breaking change, because the previous mechanism for receiving parameters no longer works, and functions that are
default export
s from runJS are no longer called automatically.#506
7592994
Thanks @calebeby! - Drop support for Node 12 and 17Minor Changes
7bb10e0
Thanks @calebeby! - Update@testing-library/dom
to8.17.1
and@testing-library/jest-dom
to5.16.5