@plyaz/types 1.5.2 → 1.5.3
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/dist/testing/common/mocks/types.d.ts +69 -48
- package/dist/testing/common/utils/types.d.ts +2441 -223
- package/package.json +1 -1
|
@@ -1717,24 +1717,17 @@ export interface AdvancedConsoleMock {
|
|
|
1717
1717
|
* ```
|
|
1718
1718
|
*/
|
|
1719
1719
|
export interface MockFormData {
|
|
1720
|
-
/** Append field */
|
|
1721
1720
|
append: Vitest.Mock;
|
|
1722
|
-
/** Delete field */
|
|
1723
1721
|
delete: Vitest.Mock;
|
|
1724
|
-
/** Get field value */
|
|
1725
1722
|
get: Vitest.Mock;
|
|
1726
|
-
/** Get all field values */
|
|
1727
1723
|
getAll: Vitest.Mock;
|
|
1728
|
-
/** Check if field exists */
|
|
1729
1724
|
has: Vitest.Mock;
|
|
1730
|
-
/** Set field value */
|
|
1731
1725
|
set: Vitest.Mock;
|
|
1732
|
-
/** Iterate entries */
|
|
1733
1726
|
entries: Vitest.Mock;
|
|
1734
|
-
/** Iterate keys */
|
|
1735
1727
|
keys: Vitest.Mock;
|
|
1736
|
-
/** Iterate values */
|
|
1737
1728
|
values: Vitest.Mock;
|
|
1729
|
+
forEach: Vitest.Mock;
|
|
1730
|
+
_entries: Map<string, Array<string | Blob>>;
|
|
1738
1731
|
}
|
|
1739
1732
|
/**
|
|
1740
1733
|
* Mock Axios implementation for testing HTTP requests.
|
|
@@ -1758,31 +1751,51 @@ export interface MockFormData {
|
|
|
1758
1751
|
* ```
|
|
1759
1752
|
*/
|
|
1760
1753
|
export interface MockAxios {
|
|
1761
|
-
/** GET request */
|
|
1762
1754
|
get: Vitest.Mock;
|
|
1763
|
-
/** POST request */
|
|
1764
1755
|
post: Vitest.Mock;
|
|
1765
|
-
/** PUT request */
|
|
1766
1756
|
put: Vitest.Mock;
|
|
1767
|
-
/** PATCH request */
|
|
1768
1757
|
patch: Vitest.Mock;
|
|
1769
|
-
/** DELETE request */
|
|
1770
1758
|
delete: Vitest.Mock;
|
|
1771
|
-
/** HEAD request */
|
|
1772
1759
|
head: Vitest.Mock;
|
|
1773
|
-
/** OPTIONS request */
|
|
1774
1760
|
options: Vitest.Mock;
|
|
1775
|
-
|
|
1761
|
+
request: Vitest.Mock;
|
|
1762
|
+
create: Vitest.Mock;
|
|
1763
|
+
defaults: {
|
|
1764
|
+
headers: {
|
|
1765
|
+
common: Record<string, string>;
|
|
1766
|
+
get: Record<string, string>;
|
|
1767
|
+
post: Record<string, string>;
|
|
1768
|
+
put: Record<string, string>;
|
|
1769
|
+
patch: Record<string, string>;
|
|
1770
|
+
delete: Record<string, string>;
|
|
1771
|
+
};
|
|
1772
|
+
baseURL?: string;
|
|
1773
|
+
timeout?: number;
|
|
1774
|
+
withCredentials?: boolean;
|
|
1775
|
+
};
|
|
1776
1776
|
interceptors: {
|
|
1777
1777
|
request: {
|
|
1778
1778
|
use: Vitest.Mock;
|
|
1779
1779
|
eject: Vitest.Mock;
|
|
1780
|
+
handlers: Array<{
|
|
1781
|
+
fulfilled: Function;
|
|
1782
|
+
rejected?: Function;
|
|
1783
|
+
}>;
|
|
1780
1784
|
};
|
|
1781
1785
|
response: {
|
|
1782
1786
|
use: Vitest.Mock;
|
|
1783
1787
|
eject: Vitest.Mock;
|
|
1788
|
+
handlers: Array<{
|
|
1789
|
+
fulfilled: Function;
|
|
1790
|
+
rejected?: Function;
|
|
1791
|
+
}>;
|
|
1784
1792
|
};
|
|
1785
1793
|
};
|
|
1794
|
+
mockResponse: Vitest.Mock;
|
|
1795
|
+
mockError: Vitest.Mock;
|
|
1796
|
+
mockResponseOnce: Vitest.Mock;
|
|
1797
|
+
mockErrorOnce: Vitest.Mock;
|
|
1798
|
+
reset: Vitest.Mock;
|
|
1786
1799
|
}
|
|
1787
1800
|
/**
|
|
1788
1801
|
* Mock Headers implementation for testing HTTP headers.
|
|
@@ -1807,22 +1820,16 @@ export interface MockAxios {
|
|
|
1807
1820
|
* ```
|
|
1808
1821
|
*/
|
|
1809
1822
|
export interface MockHeaders {
|
|
1810
|
-
/** Append header */
|
|
1811
1823
|
append: Vitest.Mock;
|
|
1812
|
-
/** Delete header */
|
|
1813
1824
|
delete: Vitest.Mock;
|
|
1814
|
-
/** Get header value */
|
|
1815
1825
|
get: Vitest.Mock;
|
|
1816
|
-
/** Check if header exists */
|
|
1817
1826
|
has: Vitest.Mock;
|
|
1818
|
-
/** Set header value */
|
|
1819
1827
|
set: Vitest.Mock;
|
|
1820
|
-
/** Iterate entries */
|
|
1821
1828
|
entries: Vitest.Mock;
|
|
1822
|
-
/** Iterate keys */
|
|
1823
1829
|
keys: Vitest.Mock;
|
|
1824
|
-
/** Iterate values */
|
|
1825
1830
|
values: Vitest.Mock;
|
|
1831
|
+
forEach: Vitest.Mock;
|
|
1832
|
+
_headers: Map<string, string>;
|
|
1826
1833
|
}
|
|
1827
1834
|
/**
|
|
1828
1835
|
* Mock cookie manager for testing cookie operations.
|
|
@@ -1844,20 +1851,18 @@ export interface MockHeaders {
|
|
|
1844
1851
|
* ```
|
|
1845
1852
|
*/
|
|
1846
1853
|
export interface MockCookie {
|
|
1847
|
-
/** Get cookie */
|
|
1848
1854
|
get: Vitest.Mock;
|
|
1849
|
-
/** Set cookie */
|
|
1850
1855
|
set: Vitest.Mock;
|
|
1851
|
-
/** Delete cookie */
|
|
1852
1856
|
delete: Vitest.Mock;
|
|
1853
|
-
/** Get all cookies */
|
|
1854
|
-
getAll: Vitest.Mock;
|
|
1855
|
-
/** Clear cookies */
|
|
1856
1857
|
clear: Vitest.Mock;
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
/** Serialize cookie */
|
|
1858
|
+
getAll: Vitest.Mock;
|
|
1859
|
+
has: Vitest.Mock;
|
|
1860
1860
|
serialize: Vitest.Mock;
|
|
1861
|
+
parse: Vitest.Mock;
|
|
1862
|
+
_cookies: Map<string, {
|
|
1863
|
+
value: string;
|
|
1864
|
+
options?: unknown;
|
|
1865
|
+
}>;
|
|
1861
1866
|
}
|
|
1862
1867
|
/**
|
|
1863
1868
|
* Mock session implementation for testing session management.
|
|
@@ -1881,20 +1886,20 @@ export interface MockCookie {
|
|
|
1881
1886
|
* ```
|
|
1882
1887
|
*/
|
|
1883
1888
|
export interface MockSession {
|
|
1884
|
-
/** Get session value */
|
|
1885
1889
|
get: Vitest.Mock;
|
|
1886
|
-
/** Set session value */
|
|
1887
1890
|
set: Vitest.Mock;
|
|
1888
|
-
/** Delete session value */
|
|
1889
1891
|
delete: Vitest.Mock;
|
|
1890
|
-
/** Clear session */
|
|
1891
1892
|
clear: Vitest.Mock;
|
|
1892
|
-
|
|
1893
|
+
has: Vitest.Mock;
|
|
1893
1894
|
save: Vitest.Mock;
|
|
1894
|
-
/** Destroy session */
|
|
1895
1895
|
destroy: Vitest.Mock;
|
|
1896
|
-
|
|
1896
|
+
regenerate: Vitest.Mock;
|
|
1897
1897
|
touch: Vitest.Mock;
|
|
1898
|
+
reload: Vitest.Mock;
|
|
1899
|
+
id: string;
|
|
1900
|
+
_data: Record<string, unknown>;
|
|
1901
|
+
_dirty: boolean;
|
|
1902
|
+
_destroyed: boolean;
|
|
1898
1903
|
}
|
|
1899
1904
|
/**
|
|
1900
1905
|
* Mock HTTP interceptor for testing request/response interception.
|
|
@@ -1918,16 +1923,32 @@ export interface MockSession {
|
|
|
1918
1923
|
* ```
|
|
1919
1924
|
*/
|
|
1920
1925
|
export interface MockInterceptor {
|
|
1921
|
-
/** Intercept requests */
|
|
1922
1926
|
intercept: Vitest.Mock;
|
|
1923
|
-
/** Capture requests */
|
|
1924
1927
|
capture: Vitest.Mock;
|
|
1925
|
-
/** Reply to requests */
|
|
1926
1928
|
reply: Vitest.Mock;
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1929
|
+
replyWithError: Vitest.Mock;
|
|
1930
|
+
delay: Vitest.Mock;
|
|
1931
|
+
times: Vitest.Mock;
|
|
1932
|
+
persist: Vitest.Mock;
|
|
1933
|
+
once: Vitest.Mock;
|
|
1934
|
+
reset: Vitest.Mock;
|
|
1935
|
+
isDone: Vitest.Mock;
|
|
1936
|
+
_matches: Array<{
|
|
1937
|
+
method: string;
|
|
1938
|
+
path: string;
|
|
1939
|
+
response?: unknown;
|
|
1940
|
+
error?: Error;
|
|
1941
|
+
delay?: number;
|
|
1942
|
+
times?: number;
|
|
1943
|
+
persistent?: boolean;
|
|
1944
|
+
}>;
|
|
1945
|
+
_captured: Array<{
|
|
1946
|
+
method: string;
|
|
1947
|
+
url: string;
|
|
1948
|
+
headers: Record<string, string>;
|
|
1949
|
+
body?: unknown;
|
|
1950
|
+
timestamp: number;
|
|
1951
|
+
}>;
|
|
1931
1952
|
}
|
|
1932
1953
|
/**
|
|
1933
1954
|
* Mock OS module interface for testing OS-specific functionality.
|