@najemi-software/vitest-dom 0.33.0 → 0.33.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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.33.1] - 2026-09-27
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Allow the exported `toHaveClass` matcher function to accept multiple class names followed by an options object, e.g. `toHaveClass(element, "a", "b", { exact: true })`, which was supported at runtime but rejected by its types
|
|
13
|
+
|
|
8
14
|
## [0.33.0] - 2026-09-27
|
|
9
15
|
|
|
10
16
|
### Changed
|
|
@@ -304,6 +310,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
304
310
|
|
|
305
311
|
- Initial release
|
|
306
312
|
|
|
313
|
+
[0.33.1]: https://github.com/Najemi-Software/vitest-dom/compare/v0.33.0...v0.33.1
|
|
307
314
|
[0.33.0]: https://github.com/Najemi-Software/vitest-dom/compare/v0.32.0...v0.33.0
|
|
308
315
|
[0.32.0]: https://github.com/Najemi-Software/vitest-dom/compare/v0.31.0...v0.32.0
|
|
309
316
|
[0.31.0]: https://github.com/Najemi-Software/vitest-dom/compare/v0.30.2...v0.31.0
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { IMatcherResult, MatcherState } from "./types.js";
|
|
2
|
+
interface IToHaveClassOptions {
|
|
3
|
+
exact: boolean;
|
|
4
|
+
}
|
|
2
5
|
/**
|
|
3
6
|
* @description
|
|
4
7
|
* Check whether the given element has certain classes within its `class` attribute.
|
|
@@ -24,4 +27,5 @@ import type { IMatcherResult, MatcherState } from "./types.js";
|
|
|
24
27
|
* @see
|
|
25
28
|
* [testing-library/jest-dom#tohaveclass](https://github.com/testing-library/jest-dom#tohaveclass)
|
|
26
29
|
*/
|
|
27
|
-
export declare function toHaveClass(this: MatcherState, htmlElement: Element, ...params: string[]): IMatcherResult;
|
|
30
|
+
export declare function toHaveClass(this: MatcherState, htmlElement: Element, ...params: string[] | [classNames: string, options?: IToHaveClassOptions] | [...classNames: string[], options: IToHaveClassOptions]): IMatcherResult;
|
|
31
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-have-class.js","sourceRoot":"","sources":["../../src/matchers/to-have-class.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM1D,SAAS,+BAA+B,CAAC,
|
|
1
|
+
{"version":3,"file":"to-have-class.js","sourceRoot":"","sources":["../../src/matchers/to-have-class.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM1D,SAAS,+BAA+B,CAAC,MAAuD;IAC5F,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC;IAC/B,IAAI,kBAA6C,EAAE,OAA4B,CAAC;IAEhF,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;QAChC,kBAAkB,GAAG,MAAkB,CAAC;QACxC,OAAO,GAAG,SAAS,CAAC;IACxB,CAAC;SAAM,CAAC;QACJ,kBAAkB,GAAI,MAAmB,CAAC,MAAM,CAAC,SAAmB,CAAC,CAAC;QACtE,OAAO,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC/B,CAAC;IACD,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,eAAe,CAAC,GAA8B;IACnD,IAAI,CAAC,GAAG,EAAE,CAAC;QACP,OAAO,EAAE,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAA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UAAU,EACV,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CACrB;gBACH,CAAC,CAAC;oBACI,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,cAAc,EAAE,SAAS,CAAC;oBACjD,+CAA+C;iBAClD,CAAC,IAAI,CAAC,IAAI,CAAC;SACzB,CAAC;AACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@najemi-software/vitest-dom",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Custom Vitest matchers to test the state of the DOM, forked from jest-dom.",
|
|
6
6
|
"homepage": "https://github.com/Najemi-Software/vitest-dom#readme",
|