vitest-auto-spy 5.17.0 → 5.17.1

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/AGENTS.md CHANGED
@@ -1676,7 +1676,10 @@ share a worker and never alone. The guard records the attributes of `<html>`, `<
1676
1676
  before each test and compares them from `onTestFinished` — **after** the TestBed destroyed the
1677
1677
  fixtures in its own `afterEach`, so what a component removes in `ngOnDestroy` / `DestroyRef.onDestroy`
1678
1678
  is never reported. Every attribute added, changed or removed is named with both values, put back,
1679
- and fails that test. A change made in a `beforeAll` and never undone fails the file, checked from a
1679
+ and fails that test. An empty `class` or `style` reads as the attribute being absent, in both
1680
+ directions — `classList.add` followed by `remove` leaves `class=""` where there was none and nothing
1681
+ observable changed; any other empty value, `data-reset-focus=""` included, is still reported.
1682
+ A change made in a `beforeAll` and never undone fails the file, checked from a
1680
1683
  `beforeAll` cleanup after every `afterAll`. `nodes: true` also watches the child elements of `<head>`
1681
1684
  and `<body>`; it is off by default because a module that injects a stylesheet on first import does
1682
1685
  so once per worker. Blind spots: a write made while the spec file is imported, and a fixture kept
package/dist/cli.js CHANGED
@@ -2455,7 +2455,7 @@ function checkForeignPragma(graph) {
2455
2455
  }
2456
2456
 
2457
2457
  // src/cli/checks/export-map.generated.ts
2458
- var EXPORT_MAP_VERSION = "5.17.0";
2458
+ var EXPORT_MAP_VERSION = "5.17.1";
2459
2459
  var ENTRY_SPECIFIERS = "vitest-auto-spy vitest-auto-spy/bun vitest-auto-spy/bun-angular vitest-auto-spy/node vitest-auto-spy/rstest vitest-auto-spy/rxjs vitest-auto-spy/console vitest-auto-spy/dom-stubs vitest-auto-spy/diagnostics vitest-auto-spy/jasmine vitest-auto-spy/jasmine-compat vitest-auto-spy/observer-spy vitest-auto-spy/angular vitest-auto-spy/angular-http vitest-auto-spy/angular-router vitest-auto-spy/signal-forms vitest-auto-spy/nestjs vitest-auto-spy/react vitest-auto-spy/vue vitest-auto-spy/svelte vitest-auto-spy/setup vitest-auto-spy/zone vitest-auto-spy/eslint-plugin";
2460
2460
  var EXPORTED_BY = {
2461
2461
  AccessorImplementations: "0 1 2 3 4 12 17 18 19",
package/dist/setup.js CHANGED
@@ -125,8 +125,14 @@ function resolveDocumentPollution(option) {
125
125
  function isIgnoredAttribute(name, ignore) {
126
126
  return ignore.some((pattern) => typeof pattern === "string" ? pattern === name : pattern.test(name));
127
127
  }
128
+ var EMPTY_MEANS_ABSENT = /* @__PURE__ */ new Set(["class", "style"]);
129
+ function isEmptyMeansAbsent({ name, value }) {
130
+ return value === "" && EMPTY_MEANS_ABSENT.has(name);
131
+ }
128
132
  function readAttributes(element, ignore) {
129
- return new Map([...element.attributes].filter(({ name }) => !isIgnoredAttribute(name, ignore)).map(({ name, value }) => [name, value]));
133
+ return new Map(
134
+ [...element.attributes].filter((attribute) => !isIgnoredAttribute(attribute.name, ignore) && !isEmptyMeansAbsent(attribute)).map(({ name, value }) => [name, value])
135
+ );
130
136
  }
131
137
  function readChildren(element, options) {
132
138
  if (!options.nodes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-auto-spy",
3
- "version": "5.17.0",
3
+ "version": "5.17.1",
4
4
  "description": "Auto-generate fully-typed test spies from a class — across Vitest, Bun, node:test and Rstest, with Angular/NestJS/React/Vue/Svelte recipes. Drop-in replacement for jest-auto-spies and jasmine-auto-spies.",
5
5
  "keywords": [
6
6
  "auto-mock",