@najemi-software/vitest-dom 1.0.1 → 1.1.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/CHANGELOG.md +7 -0
- package/esm/index.d.ts +18 -3
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/matchers/to-be-checked.d.ts +8 -1
- package/esm/matchers/to-be-checked.d.ts.map +1 -1
- package/esm/matchers/to-be-checked.js +8 -1
- package/esm/matchers/to-be-checked.js.map +1 -1
- package/esm/matchers/to-be-disabled.d.ts +10 -2
- package/esm/matchers/to-be-disabled.d.ts.map +1 -1
- package/esm/matchers/to-be-disabled.js +10 -2
- package/esm/matchers/to-be-disabled.js.map +1 -1
- package/esm/matchers/to-be-empty-dom-element.d.ts +2 -1
- package/esm/matchers/to-be-empty-dom-element.d.ts.map +1 -1
- package/esm/matchers/to-be-empty-dom-element.js +2 -1
- package/esm/matchers/to-be-empty-dom-element.js.map +1 -1
- package/esm/matchers/to-be-empty.d.ts +5 -2
- package/esm/matchers/to-be-empty.d.ts.map +1 -1
- package/esm/matchers/to-be-empty.js +5 -2
- package/esm/matchers/to-be-empty.js.map +1 -1
- package/esm/matchers/to-be-in-the-document.d.ts +2 -1
- package/esm/matchers/to-be-in-the-document.d.ts.map +1 -1
- package/esm/matchers/to-be-in-the-document.js +2 -1
- package/esm/matchers/to-be-in-the-document.js.map +1 -1
- package/esm/matchers/to-be-in-the-dom.d.ts +6 -3
- package/esm/matchers/to-be-in-the-dom.d.ts.map +1 -1
- package/esm/matchers/to-be-in-the-dom.js +6 -3
- package/esm/matchers/to-be-in-the-dom.js.map +1 -1
- package/esm/matchers/to-be-invalid.d.ts +16 -2
- package/esm/matchers/to-be-invalid.d.ts.map +1 -1
- package/esm/matchers/to-be-invalid.js +16 -2
- package/esm/matchers/to-be-invalid.js.map +1 -1
- package/esm/matchers/to-be-partially-checked.d.ts +7 -1
- package/esm/matchers/to-be-partially-checked.d.ts.map +1 -1
- package/esm/matchers/to-be-partially-checked.js +7 -1
- package/esm/matchers/to-be-partially-checked.js.map +1 -1
- package/esm/matchers/to-be-required.d.ts +8 -1
- package/esm/matchers/to-be-required.d.ts.map +1 -1
- package/esm/matchers/to-be-required.js +8 -1
- package/esm/matchers/to-be-required.js.map +1 -1
- package/esm/matchers/to-be-visible.d.ts +2 -1
- package/esm/matchers/to-be-visible.d.ts.map +1 -1
- package/esm/matchers/to-be-visible.js +2 -1
- package/esm/matchers/to-be-visible.js.map +1 -1
- package/esm/matchers/to-contain-element.d.ts +2 -1
- package/esm/matchers/to-contain-element.d.ts.map +1 -1
- package/esm/matchers/to-contain-element.js +2 -1
- package/esm/matchers/to-contain-element.js.map +1 -1
- package/esm/matchers/to-contain-html.d.ts +2 -1
- package/esm/matchers/to-contain-html.d.ts.map +1 -1
- package/esm/matchers/to-contain-html.js +2 -1
- package/esm/matchers/to-contain-html.js.map +1 -1
- package/esm/matchers/to-have-accessible-description.d.ts +2 -1
- package/esm/matchers/to-have-accessible-description.d.ts.map +1 -1
- package/esm/matchers/to-have-accessible-description.js +2 -1
- package/esm/matchers/to-have-accessible-description.js.map +1 -1
- package/esm/matchers/to-have-accessible-errormessage.d.ts +6 -1
- package/esm/matchers/to-have-accessible-errormessage.d.ts.map +1 -1
- package/esm/matchers/to-have-accessible-errormessage.js +6 -1
- package/esm/matchers/to-have-accessible-errormessage.js.map +1 -1
- package/esm/matchers/to-have-accessible-name.d.ts +2 -1
- package/esm/matchers/to-have-accessible-name.d.ts.map +1 -1
- package/esm/matchers/to-have-accessible-name.js +2 -1
- package/esm/matchers/to-have-accessible-name.js.map +1 -1
- package/esm/matchers/to-have-attribute.d.ts +8 -1
- package/esm/matchers/to-have-attribute.d.ts.map +1 -1
- package/esm/matchers/to-have-attribute.js +8 -1
- package/esm/matchers/to-have-attribute.js.map +1 -1
- package/esm/matchers/to-have-class.d.ts +12 -3
- package/esm/matchers/to-have-class.d.ts.map +1 -1
- package/esm/matchers/to-have-class.js +8 -1
- package/esm/matchers/to-have-class.js.map +1 -1
- package/esm/matchers/to-have-description.d.ts +10 -3
- package/esm/matchers/to-have-description.d.ts.map +1 -1
- package/esm/matchers/to-have-description.js +10 -3
- package/esm/matchers/to-have-description.js.map +1 -1
- package/esm/matchers/to-have-display-value.d.ts +7 -1
- package/esm/matchers/to-have-display-value.d.ts.map +1 -1
- package/esm/matchers/to-have-display-value.js +7 -1
- package/esm/matchers/to-have-display-value.js.map +1 -1
- package/esm/matchers/to-have-errormessage.d.ts +3 -3
- package/esm/matchers/to-have-errormessage.js +3 -3
- package/esm/matchers/to-have-focus.d.ts +2 -1
- package/esm/matchers/to-have-focus.d.ts.map +1 -1
- package/esm/matchers/to-have-focus.js +2 -1
- package/esm/matchers/to-have-focus.js.map +1 -1
- package/esm/matchers/to-have-form-values.d.ts +8 -1
- package/esm/matchers/to-have-form-values.d.ts.map +1 -1
- package/esm/matchers/to-have-form-values.js +8 -1
- package/esm/matchers/to-have-form-values.js.map +1 -1
- package/esm/matchers/to-have-style.d.ts +8 -1
- package/esm/matchers/to-have-style.d.ts.map +1 -1
- package/esm/matchers/to-have-style.js +8 -1
- package/esm/matchers/to-have-style.js.map +1 -1
- package/esm/matchers/to-have-text-content.d.ts +2 -1
- package/esm/matchers/to-have-text-content.d.ts.map +1 -1
- package/esm/matchers/to-have-text-content.js +2 -1
- package/esm/matchers/to-have-text-content.js.map +1 -1
- package/esm/matchers/to-have-value.d.ts +2 -1
- package/esm/matchers/to-have-value.d.ts.map +1 -1
- package/esm/matchers/to-have-value.js +2 -1
- package/esm/matchers/to-have-value.js.map +1 -1
- package/esm/matchers/types.d.ts +15 -0
- package/esm/matchers/types.d.ts.map +1 -1
- package/esm/tsdoc-metadata.json +11 -0
- package/esm/vitest-dom.d.ts +882 -0
- package/package.json +4 -2
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IMatcherResult, MatcherState } from "./types.js";
|
|
2
2
|
/**
|
|
3
|
-
* @description
|
|
4
3
|
* Check whether the given form element has the specified value.
|
|
5
4
|
*
|
|
6
5
|
* Accepts `<input>`, `<select>`, and `<textarea>` elements with the exception of `<input type="checkbox">` and
|
|
@@ -17,6 +16,8 @@ import type { IMatcherResult, MatcherState } from "./types.js";
|
|
|
17
16
|
* expect(numberInput).toHaveValue(5)
|
|
18
17
|
* @see
|
|
19
18
|
* [testing-library/jest-dom#tohavevalue](https://github.com/testing-library/jest-dom#tohavevalue)
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
20
21
|
*/
|
|
21
22
|
export declare function toHaveValue(this: MatcherState, htmlElement: Element, expectedValue?: string | string[] | number | null): IMatcherResult;
|
|
22
23
|
//# sourceMappingURL=to-have-value.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-have-value.d.ts","sourceRoot":"","sources":["../../src/matchers/to-have-value.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/D
|
|
1
|
+
{"version":3,"file":"to-have-value.d.ts","sourceRoot":"","sources":["../../src/matchers/to-have-value.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CACvB,IAAI,EAAE,YAAY,EAClB,WAAW,EAAE,OAAO,EACpB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,GAClD,cAAc,CA2ChB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { isEqualWith } from "lodash-es";
|
|
2
2
|
import { checkHtmlElement, compareArraysAsSet, getMessage, getSingleElementValue } from "./utils.js";
|
|
3
3
|
/**
|
|
4
|
-
* @description
|
|
5
4
|
* Check whether the given form element has the specified value.
|
|
6
5
|
*
|
|
7
6
|
* Accepts `<input>`, `<select>`, and `<textarea>` elements with the exception of `<input type="checkbox">` and
|
|
@@ -18,6 +17,8 @@ import { checkHtmlElement, compareArraysAsSet, getMessage, getSingleElementValue
|
|
|
18
17
|
* expect(numberInput).toHaveValue(5)
|
|
19
18
|
* @see
|
|
20
19
|
* [testing-library/jest-dom#tohavevalue](https://github.com/testing-library/jest-dom#tohavevalue)
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
21
22
|
*/
|
|
22
23
|
export function toHaveValue(htmlElement, expectedValue) {
|
|
23
24
|
checkHtmlElement(htmlElement, toHaveValue, this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"to-have-value.js","sourceRoot":"","sources":["../../src/matchers/to-have-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAErG
|
|
1
|
+
{"version":3,"file":"to-have-value.js","sourceRoot":"","sources":["../../src/matchers/to-have-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAErG;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,WAAW,CAEvB,WAAoB,EACpB,aAAiD;IAEjD,gBAAgB,CAAC,WAAW,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAEjD,IACI,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,OAAO;QAC7C,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAE,WAAgC,CAAC,IAAI,CAAC,EACxE,CAAC;QACC,MAAM,IAAI,KAAK,CACX,gJAAgJ,CACnJ,CAAC;IACN,CAAC;IAED,MAAM,aAAa,GAAG,qBAAqB,CAAC,W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
|
|
3
6
|
pass: boolean;
|
|
4
7
|
message(): string;
|
|
@@ -6,10 +9,22 @@ export interface IMatcherResult {
|
|
|
6
9
|
expected?: unknown;
|
|
7
10
|
meta?: object;
|
|
8
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
9
15
|
export type ExpectationResult = IMatcherResult | Promise<IMatcherResult>;
|
|
16
|
+
/**
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
10
19
|
export interface IMatcherFn<State extends MatcherState, Args extends unknown[] = any[]> {
|
|
11
20
|
(this: State, received: any, ...args: Args): ExpectationResult;
|
|
12
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
13
25
|
export type MatcherState = ReturnType<ExpectStatic["getState"]>;
|
|
26
|
+
/**
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
14
29
|
export type MatcherArgs<F> = F extends IMatcherFn<MatcherState, infer Args> ? Args : never;
|
|
15
30
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/matchers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,IAAI,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEzE,MAAM,WAAW,UAAU,CAAC,KAAK,SAAS,YAAY,EAAE,IAAI,SAAS,OAAO,EAAE,GAAG,GAAG,EAAE;IAClF,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,iBAAiB,CAAC;CAClE;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;AAEhE,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/matchers/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,IAAI,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,KAAK,SAAS,YAAY,EAAE,IAAI,SAAS,OAAO,EAAE,GAAG,GAAG,EAAE;IAClF,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,iBAAiB,CAAC;CAClE;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CAAC,YAAY,EAAE,MAAM,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.59.2"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|