Releases: cloudfour/pleasantest
v0.6.1
v0.6.0
Minor Changes
-
#115
b4eb08d
Thanks @calebeby! - Replace vite-based module server with wmr-based custom module server
(This is probably a breaking change - minor bump is only because pre-1.0) -
#126
e06e6bc
Thanks @calebeby! - Improve error message display for errors coming from browsers -
#116
5afa0a6
Thanks @calebeby! - Add support for static files and css requested directly -
#106
994b810
Thanks @calebeby! - Cache browser instances locally instead of globally
Patch Changes
v0.5.0
v0.4.1
v0.4.0
v0.3.0
v0.2.2
v0.2.1
v0.2.0
Minor Changes
-
064e5b4
#48 Thanks @calebeby! - - Add user.type method- Add actionability checks: visible and attached
-
beb1914
#43 Thanks @calebeby! - Provide a helpful message if the user forgets to useawait
.For example, if a user forgets to use
await
in the jest-dom assertion:test( 'example', withBrowser(async ({ screen, utils }) => { await utils.injectHTML('<button>Hi</button>'); const button = await screen.getByText(/hi/i); expect(button).toBeVisible(); }), );
Then a useful error message is produced:
Cannot execute assertion toBeVisible after test finishes. Did you forget to await? 103 | await utils.injectHTML('<button>Hi</button>'); 104 | const button = await screen.getByText(/hi/i); > 105 | expect(button).toBeVisible(); | ^ 106 | }), 107 | ); 108 |
This is also handled for utility functions, user methods, and Testing Library queries.
-
732fbff
#45 Thanks @calebeby! - Now it is possible to pass variables to the browser in runJS:import { withBrowser } from 'test-mule'; test( 'runJS example with argument', withBrowser(async ({ utils, screen }) => { // element is an ElementHandle (pointer to an element in the browser) const element = await screen.getByText(/button/i); // we can pass element into runJS and the default exported function can access it as an Element await utils.runJS( ` export default (element) => console.log(element); `, [element], ); }), );