@uiverify/vitest 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -44,7 +44,7 @@ import { render } from "vitest-browser-react"; // or your framework's browser re
44
44
  import { takeSnapshot, disableAutoSnapshot } from "@uiverify/vitest";
45
45
 
46
46
  test("menu", async () => {
47
- render(<Menu />);
47
+ await render(<Menu />); // render() is async - await it so the DOM is committed before capture
48
48
  await takeSnapshot("closed"); // optional named checkpoint
49
49
  // the final state is archived automatically at the end of the test
50
50
  });
package/dist/plugin.js CHANGED
@@ -32,6 +32,12 @@ var SETUP_MODULE = "@uiverify/vitest/browser-setup";
32
32
  function uiverifyPlugin(options = {}) {
33
33
  const outDir = options.outDir ?? resolveOutDir();
34
34
  const config = {
35
+ // The capture state (`currentTask`) lives in module scope in `runtime.ts`, shared between the setup
36
+ // file's hooks and the user's `takeSnapshot` import. Dep pre-bundling would give those two entry
37
+ // points separate copies of that module, so `takeSnapshot()` would not see the running test and throw
38
+ // "called outside a test". Excluding the package from optimize keeps everyone on one instance, so a
39
+ // plain `plugins: [uiverifyPlugin()]` works without the user hand-adding this to their config.
40
+ optimizeDeps: { exclude: ["@uiverify/vitest"] },
35
41
  test: {
36
42
  setupFiles: [SETUP_MODULE],
37
43
  provide: { __uiverify: { disableAutoSnapshot: options.disableAutoSnapshot ?? false } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uiverify/vitest",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "Vitest browser-mode capture SDK for UI Verify (uiverify.ai): add uiverifyPlugin() to your Vitest config and each browser-mode test archives its final DOM (serialized DOM + resource bytes) to be replayed + visually diffed by UI Verify. Produces an archive the uiverify CLI uploads; talks to nothing at runtime.",
5
5
  "keywords": [
6
6
  "visual-testing",